diff options
author | 2024-03-05 22:03:10 +0100 | |
---|---|---|
committer | 2024-03-05 22:03:10 +0100 | |
commit | 87d16a090b14fa206bb87041a32d66348bc294e4 (patch) | |
tree | 77522cd0d372d23897d9957d39115846b37c50a9 | |
parent | 7d84c9c9c3619513519ac1ef7ea1c5f6e4e2cf5d (diff) | |
download | iced-87d16a090b14fa206bb87041a32d66348bc294e4.tar.gz iced-87d16a090b14fa206bb87041a32d66348bc294e4.tar.bz2 iced-87d16a090b14fa206bb87041a32d66348bc294e4.zip |
Reduce default size of `checkbox` to `15.0`
Diffstat (limited to '')
-rw-r--r-- | examples/todos/src/main.rs | 1 | ||||
-rw-r--r-- | widget/src/checkbox.rs | 8 | ||||
-rw-r--r-- | widget/src/radio.rs | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs index b3b5d87a..800d2fe0 100644 --- a/examples/todos/src/main.rs +++ b/examples/todos/src/main.rs @@ -355,6 +355,7 @@ impl Task { let checkbox = checkbox(&self.description, self.completed) .on_toggle(TaskMessage::Completed) .width(Length::Fill) + .size(17) .text_shaping(text::Shaping::Advanced); row![ diff --git a/widget/src/checkbox.rs b/widget/src/checkbox.rs index 54513b7d..91838291 100644 --- a/widget/src/checkbox.rs +++ b/widget/src/checkbox.rs @@ -62,7 +62,7 @@ where Theme: Style, { /// The default size of a [`Checkbox`]. - const DEFAULT_SIZE: f32 = 20.0; + const DEFAULT_SIZE: f32 = 15.0; /// The default spacing of a [`Checkbox`]. const DEFAULT_SPACING: f32 = 10.0; @@ -91,7 +91,7 @@ where line_height: text::LineHeight::default(), shaping: text::Shaping::Basic, }, - style: Theme::default(), + style: Theme::style(), } } @@ -426,11 +426,11 @@ pub struct Appearance { /// A set of rules that dictate the style of a checkbox. pub trait Style { /// The supported style of the [`StyleSheet`]. - fn default() -> fn(&Self, Status) -> Appearance; + fn style() -> fn(&Self, Status) -> Appearance; } impl Style for Theme { - fn default() -> fn(&Self, Status) -> Appearance { + fn style() -> fn(&Self, Status) -> Appearance { primary } } diff --git a/widget/src/radio.rs b/widget/src/radio.rs index c4283af8..90a10a0b 100644 --- a/widget/src/radio.rs +++ b/widget/src/radio.rs @@ -91,7 +91,7 @@ where Renderer: text::Renderer, { /// The default size of a [`Radio`] button. - pub const DEFAULT_SIZE: f32 = 14.0; + pub const DEFAULT_SIZE: f32 = 15.0; /// The default spacing of a [`Radio`] button. pub const DEFAULT_SPACING: f32 = 10.0; |