From 7d2d813343baae10c2667590463385d50abb784c Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Mon, 23 Jan 2023 16:57:24 +0100 Subject: added new style for scrollable, to be applied when mouse is over the scrollable area --- style/src/scrollable.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'style/src') diff --git a/style/src/scrollable.rs b/style/src/scrollable.rs index 64ed8462..a3f3db20 100644 --- a/style/src/scrollable.rs +++ b/style/src/scrollable.rs @@ -45,6 +45,11 @@ pub trait StyleSheet { self.hovered(style) } + /// Produces the style of a scrollbar when mouse is over the scrollable area. + fn focused(&self, style: &Self::Style) -> Scrollbar { + self.active(style) + } + /// Produces the style of an active horizontal scrollbar. fn active_horizontal(&self, style: &Self::Style) -> Scrollbar { self.active(style) @@ -59,4 +64,9 @@ pub trait StyleSheet { fn dragging_horizontal(&self, style: &Self::Style) -> Scrollbar { self.hovered_horizontal(style) } + + /// Produces the style of a horizontal scrollbar when mouse is over the scrollable area. + fn focused_horizontal(&self, style: &Self::Style) -> Scrollbar { + self.active_horizontal(style) + } } -- cgit From 49e9a9a5379c1e9a9469045ca9a51ffb860ee620 Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Mon, 23 Jan 2023 17:56:39 +0100 Subject: added function focused and focused_horizontal to theme.rs --- style/src/theme.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'style/src') diff --git a/style/src/theme.rs b/style/src/theme.rs index 55bfa4ca..8d40bda1 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -935,6 +935,13 @@ impl scrollable::StyleSheet for Theme { } } + fn focused(&self, style: &Self::Style) -> scrollable::Scrollbar { + match style { + Scrollable::Default => self.active(style), + Scrollable::Custom(custom) => custom.focused(self), + } + } + fn active_horizontal(&self, style: &Self::Style) -> scrollable::Scrollbar { match style { Scrollable::Default => self.active(style), @@ -958,6 +965,16 @@ impl scrollable::StyleSheet for Theme { Scrollable::Custom(custom) => custom.dragging_horizontal(self), } } + + fn focused_horizontal( + &self, + style: &Self::Style, + ) -> scrollable::Scrollbar { + match style { + Scrollable::Default => self.active_horizontal(style), + Scrollable::Custom(custom) => custom.focused_horizontal(self), + } + } } /// The style of text. -- cgit From c337bf297d1836c429cd24964e8b3bdcc13850be Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Sat, 25 Mar 2023 01:05:56 +0100 Subject: renamed scrollable styles --- style/src/scrollable.rs | 14 +++++++------- style/src/theme.rs | 20 ++++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'style/src') diff --git a/style/src/scrollable.rs b/style/src/scrollable.rs index a3f3db20..f3c04235 100644 --- a/style/src/scrollable.rs +++ b/style/src/scrollable.rs @@ -38,15 +38,15 @@ pub trait StyleSheet { fn active(&self, style: &Self::Style) -> Scrollbar; /// Produces the style of a hovered scrollbar. - fn hovered(&self, style: &Self::Style) -> Scrollbar; + fn hovered_scrollbar(&self, style: &Self::Style) -> Scrollbar; /// Produces the style of a scrollbar that is being dragged. fn dragging(&self, style: &Self::Style) -> Scrollbar { - self.hovered(style) + self.hovered_scrollbar(style) } /// Produces the style of a scrollbar when mouse is over the scrollable area. - fn focused(&self, style: &Self::Style) -> Scrollbar { + fn hovered(&self, style: &Self::Style) -> Scrollbar { self.active(style) } @@ -56,17 +56,17 @@ pub trait StyleSheet { } /// Produces the style of a hovered horizontal scrollbar. - fn hovered_horizontal(&self, style: &Self::Style) -> Scrollbar { - self.hovered(style) + fn hovered_scrollbar_horizontal(&self, style: &Self::Style) -> Scrollbar { + self.hovered_scrollbar(style) } /// Produces the style of a horizontal scrollbar that is being dragged. fn dragging_horizontal(&self, style: &Self::Style) -> Scrollbar { - self.hovered_horizontal(style) + self.hovered_scrollbar_horizontal(style) } /// Produces the style of a horizontal scrollbar when mouse is over the scrollable area. - fn focused_horizontal(&self, style: &Self::Style) -> Scrollbar { + fn hovered_horizontal(&self, style: &Self::Style) -> Scrollbar { self.active_horizontal(style) } } diff --git a/style/src/theme.rs b/style/src/theme.rs index 1d262562..9a3105b5 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -906,7 +906,7 @@ impl scrollable::StyleSheet for Theme { } } - fn hovered(&self, style: &Self::Style) -> scrollable::Scrollbar { + fn hovered_scrollbar(&self, style: &Self::Style) -> scrollable::Scrollbar { match style { Scrollable::Default => { let palette = self.extended_palette(); @@ -924,21 +924,21 @@ impl scrollable::StyleSheet for Theme { }, } } - Scrollable::Custom(custom) => custom.hovered(self), + Scrollable::Custom(custom) => custom.hovered_scrollbar(self), } } fn dragging(&self, style: &Self::Style) -> scrollable::Scrollbar { match style { - Scrollable::Default => self.hovered(style), + Scrollable::Default => self.hovered_scrollbar(style), Scrollable::Custom(custom) => custom.dragging(self), } } - fn focused(&self, style: &Self::Style) -> scrollable::Scrollbar { + fn hovered(&self, style: &Self::Style) -> scrollable::Scrollbar { match style { Scrollable::Default => self.active(style), - Scrollable::Custom(custom) => custom.focused(self), + Scrollable::Custom(custom) => custom.hovered(self), } } @@ -949,10 +949,10 @@ impl scrollable::StyleSheet for Theme { } } - fn hovered_horizontal(&self, style: &Self::Style) -> scrollable::Scrollbar { + fn hovered_scrollbar_horizontal(&self, style: &Self::Style) -> scrollable::Scrollbar { match style { - Scrollable::Default => self.hovered(style), - Scrollable::Custom(custom) => custom.hovered_horizontal(self), + Scrollable::Default => self.hovered_scrollbar(style), + Scrollable::Custom(custom) => custom.hovered_scrollbar_horizontal(self), } } @@ -966,13 +966,13 @@ impl scrollable::StyleSheet for Theme { } } - fn focused_horizontal( + fn hovered_horizontal( &self, style: &Self::Style, ) -> scrollable::Scrollbar { match style { Scrollable::Default => self.active_horizontal(style), - Scrollable::Custom(custom) => custom.focused_horizontal(self), + Scrollable::Custom(custom) => custom.hovered_horizontal(self), } } } -- cgit From c407b4504cd5e7dcb04a8fd31ad0400c891fc3e1 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 27 Mar 2023 15:51:32 +0200 Subject: Introduce `is_mouse_over_scrollbar` to `StyleSheet::hovered` for `Scrollable` --- style/src/scrollable.rs | 32 ++++++++++++------------- style/src/theme.rs | 63 ++++++++++++++++++++++++------------------------- 2 files changed, 46 insertions(+), 49 deletions(-) (limited to 'style/src') diff --git a/style/src/scrollable.rs b/style/src/scrollable.rs index f3c04235..64a91b69 100644 --- a/style/src/scrollable.rs +++ b/style/src/scrollable.rs @@ -37,17 +37,16 @@ pub trait StyleSheet { /// Produces the style of an active scrollbar. fn active(&self, style: &Self::Style) -> Scrollbar; - /// Produces the style of a hovered scrollbar. - fn hovered_scrollbar(&self, style: &Self::Style) -> Scrollbar; + /// Produces the style of a scrollbar when the scrollable is being hovered. + fn hovered( + &self, + style: &Self::Style, + is_mouse_over_scrollbar: bool, + ) -> Scrollbar; /// Produces the style of a scrollbar that is being dragged. fn dragging(&self, style: &Self::Style) -> Scrollbar { - self.hovered_scrollbar(style) - } - - /// Produces the style of a scrollbar when mouse is over the scrollable area. - fn hovered(&self, style: &Self::Style) -> Scrollbar { - self.active(style) + self.hovered(style, true) } /// Produces the style of an active horizontal scrollbar. @@ -55,18 +54,17 @@ pub trait StyleSheet { self.active(style) } - /// Produces the style of a hovered horizontal scrollbar. - fn hovered_scrollbar_horizontal(&self, style: &Self::Style) -> Scrollbar { - self.hovered_scrollbar(style) + /// Produces the style of a horizontal scrollbar when the scrollable is being hovered. + fn hovered_horizontal( + &self, + style: &Self::Style, + is_mouse_over_scrollbar: bool, + ) -> Scrollbar { + self.hovered(style, is_mouse_over_scrollbar) } /// Produces the style of a horizontal scrollbar that is being dragged. fn dragging_horizontal(&self, style: &Self::Style) -> Scrollbar { - self.hovered_scrollbar_horizontal(style) - } - - /// Produces the style of a horizontal scrollbar when mouse is over the scrollable area. - fn hovered_horizontal(&self, style: &Self::Style) -> Scrollbar { - self.active_horizontal(style) + self.hovered(style, true) } } diff --git a/style/src/theme.rs b/style/src/theme.rs index 9a3105b5..0ebd82a4 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -906,42 +906,45 @@ impl scrollable::StyleSheet for Theme { } } - fn hovered_scrollbar(&self, style: &Self::Style) -> scrollable::Scrollbar { + fn hovered( + &self, + style: &Self::Style, + is_mouse_over_scrollbar: bool, + ) -> scrollable::Scrollbar { match style { Scrollable::Default => { - let palette = self.extended_palette(); + if is_mouse_over_scrollbar { + let palette = self.extended_palette(); - scrollable::Scrollbar { - background: palette.background.weak.color.into(), - border_radius: 2.0, - border_width: 0.0, - border_color: Color::TRANSPARENT, - scroller: scrollable::Scroller { - color: palette.primary.strong.color, + scrollable::Scrollbar { + background: palette.background.weak.color.into(), border_radius: 2.0, border_width: 0.0, border_color: Color::TRANSPARENT, - }, + scroller: scrollable::Scroller { + color: palette.primary.strong.color, + border_radius: 2.0, + border_width: 0.0, + border_color: Color::TRANSPARENT, + }, + } + } else { + self.active(style) } } - Scrollable::Custom(custom) => custom.hovered_scrollbar(self), + Scrollable::Custom(custom) => { + custom.hovered(self, is_mouse_over_scrollbar) + } } } fn dragging(&self, style: &Self::Style) -> scrollable::Scrollbar { match style { - Scrollable::Default => self.hovered_scrollbar(style), + Scrollable::Default => self.hovered(style, true), Scrollable::Custom(custom) => custom.dragging(self), } } - fn hovered(&self, style: &Self::Style) -> scrollable::Scrollbar { - match style { - Scrollable::Default => self.active(style), - Scrollable::Custom(custom) => custom.hovered(self), - } - } - fn active_horizontal(&self, style: &Self::Style) -> scrollable::Scrollbar { match style { Scrollable::Default => self.active(style), @@ -949,30 +952,26 @@ impl scrollable::StyleSheet for Theme { } } - fn hovered_scrollbar_horizontal(&self, style: &Self::Style) -> scrollable::Scrollbar { - match style { - Scrollable::Default => self.hovered_scrollbar(style), - Scrollable::Custom(custom) => custom.hovered_scrollbar_horizontal(self), - } - } - - fn dragging_horizontal( + fn hovered_horizontal( &self, style: &Self::Style, + is_mouse_over_scrollbar: bool, ) -> scrollable::Scrollbar { match style { - Scrollable::Default => self.hovered_horizontal(style), - Scrollable::Custom(custom) => custom.dragging_horizontal(self), + Scrollable::Default => self.hovered(style, is_mouse_over_scrollbar), + Scrollable::Custom(custom) => { + custom.hovered_horizontal(self, is_mouse_over_scrollbar) + } } } - fn hovered_horizontal( + fn dragging_horizontal( &self, style: &Self::Style, ) -> scrollable::Scrollbar { match style { - Scrollable::Default => self.active_horizontal(style), - Scrollable::Custom(custom) => custom.hovered_horizontal(self), + Scrollable::Default => self.hovered_horizontal(style, true), + Scrollable::Custom(custom) => custom.dragging_horizontal(self), } } } -- cgit From dcccf7064d506abb3aab15227e6cdf34d852514d Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 27 Mar 2023 15:57:51 +0200 Subject: Fix inconsistency in default implementation of `scrollable::StyleSheet` --- style/src/scrollable.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'style/src') diff --git a/style/src/scrollable.rs b/style/src/scrollable.rs index 64a91b69..b528c444 100644 --- a/style/src/scrollable.rs +++ b/style/src/scrollable.rs @@ -65,6 +65,6 @@ pub trait StyleSheet { /// Produces the style of a horizontal scrollbar that is being dragged. fn dragging_horizontal(&self, style: &Self::Style) -> Scrollbar { - self.hovered(style, true) + self.hovered_horizontal(style, true) } } -- cgit From 7b369842959511f17d5c27941fd0308484bff8ea Mon Sep 17 00:00:00 2001 From: Casper Storm Date: Mon, 13 Feb 2023 11:38:05 +0100 Subject: feat: added handle to text_input --- style/src/text_input.rs | 2 ++ style/src/theme.rs | 3 +++ 2 files changed, 5 insertions(+) (limited to 'style/src') diff --git a/style/src/text_input.rs b/style/src/text_input.rs index d97016dc..5e703e61 100644 --- a/style/src/text_input.rs +++ b/style/src/text_input.rs @@ -12,6 +12,8 @@ pub struct Appearance { pub border_width: f32, /// The border [`Color`] of the text input. pub border_color: Color, + /// The handle [`Color`] of the text input. + pub handle_color: Color, } /// A set of rules that dictate the style of a text input. diff --git a/style/src/theme.rs b/style/src/theme.rs index 0ebd82a4..de46d7d4 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -1028,6 +1028,7 @@ impl text_input::StyleSheet for Theme { border_radius: 2.0, border_width: 1.0, border_color: palette.background.strong.color, + handle_color: palette.background.weak.text, } } @@ -1043,6 +1044,7 @@ impl text_input::StyleSheet for Theme { border_radius: 2.0, border_width: 1.0, border_color: palette.background.base.text, + handle_color: palette.background.weak.text, } } @@ -1058,6 +1060,7 @@ impl text_input::StyleSheet for Theme { border_radius: 2.0, border_width: 1.0, border_color: palette.primary.strong.color, + handle_color: palette.primary.weak.text, } } -- cgit From bfc5db9009f10a67ed277ce9d1997bcdea3f6acd Mon Sep 17 00:00:00 2001 From: Casper Storm Date: Mon, 13 Feb 2023 12:00:08 +0100 Subject: Updated `handle_color` for focused state --- style/src/theme.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'style/src') diff --git a/style/src/theme.rs b/style/src/theme.rs index de46d7d4..4837e10b 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -1060,7 +1060,7 @@ impl text_input::StyleSheet for Theme { border_radius: 2.0, border_width: 1.0, border_color: palette.primary.strong.color, - handle_color: palette.primary.weak.text, + handle_color: palette.background.weak.text, } } -- cgit From d24a4a46895ed711ddfc3199a0445f0b69a812e4 Mon Sep 17 00:00:00 2001 From: Casper Storm Date: Thu, 16 Feb 2023 14:32:59 +0100 Subject: Changed `Handle` to `Icon` to be consistent --- style/src/text_input.rs | 4 ++-- style/src/theme.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'style/src') diff --git a/style/src/text_input.rs b/style/src/text_input.rs index 5e703e61..73b05852 100644 --- a/style/src/text_input.rs +++ b/style/src/text_input.rs @@ -12,8 +12,8 @@ pub struct Appearance { pub border_width: f32, /// The border [`Color`] of the text input. pub border_color: Color, - /// The handle [`Color`] of the text input. - pub handle_color: Color, + /// The icon [`Color`] of the text input. + pub icon_color: Color, } /// A set of rules that dictate the style of a text input. diff --git a/style/src/theme.rs b/style/src/theme.rs index 4837e10b..0d974a19 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -1028,7 +1028,7 @@ impl text_input::StyleSheet for Theme { border_radius: 2.0, border_width: 1.0, border_color: palette.background.strong.color, - handle_color: palette.background.weak.text, + icon_color: palette.background.weak.text, } } @@ -1044,7 +1044,7 @@ impl text_input::StyleSheet for Theme { border_radius: 2.0, border_width: 1.0, border_color: palette.background.base.text, - handle_color: palette.background.weak.text, + icon_color: palette.background.weak.text, } } @@ -1060,7 +1060,7 @@ impl text_input::StyleSheet for Theme { border_radius: 2.0, border_width: 1.0, border_color: palette.primary.strong.color, - handle_color: palette.background.weak.text, + icon_color: palette.background.weak.text, } } -- cgit From f10e936f00d4b83dcacfdebd2727b1a5cd1add95 Mon Sep 17 00:00:00 2001 From: Dan Mishin Date: Fri, 3 Mar 2023 10:01:49 +0300 Subject: Introduce disabled state for `TextInput` --- style/src/text_input.rs | 6 ++++++ style/src/theme.rs | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) (limited to 'style/src') diff --git a/style/src/text_input.rs b/style/src/text_input.rs index 73b05852..2616ad5a 100644 --- a/style/src/text_input.rs +++ b/style/src/text_input.rs @@ -33,6 +33,9 @@ pub trait StyleSheet { /// Produces the [`Color`] of the value of a text input. fn value_color(&self, style: &Self::Style) -> Color; + /// Produces the [`Color`] of the value of a disabled text input. + fn disabled_color(&self, style: &Self::Style) -> Color; + /// Produces the [`Color`] of the selection of a text input. fn selection_color(&self, style: &Self::Style) -> Color; @@ -40,4 +43,7 @@ pub trait StyleSheet { fn hovered(&self, style: &Self::Style) -> Appearance { self.focused(style) } + + /// Produces the style of a disabled text input. + fn disabled(&self, style: &Self::Style) -> Appearance; } diff --git a/style/src/theme.rs b/style/src/theme.rs index 0d974a19..e13edb05 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -1093,4 +1093,30 @@ impl text_input::StyleSheet for Theme { palette.primary.weak.color } + + fn disabled(&self, style: &Self::Style) -> text_input::Appearance { + if let TextInput::Custom(custom) = style { + return custom.disabled(self); + } + + let palette = self.extended_palette(); + + text_input::Appearance { + background: palette.background.base.color.into(), + border_radius: 2.0, + border_width: 1.0, + border_color: palette.background.weak.color, + icon_color: palette.background.weak.color, + } + } + + fn disabled_color(&self, style: &Self::Style) -> Color { + if let TextInput::Custom(custom) = style { + return custom.value_color(self); + } + + let palette = self.extended_palette(); + + palette.secondary.strong.color + } } -- cgit From 1de794aabfaa651f021ff2e5831397d7ce9fc53c Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 12 Apr 2023 04:34:37 +0200 Subject: Fine-tune built-in styling of disabled `TextInput` --- style/src/theme.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'style/src') diff --git a/style/src/theme.rs b/style/src/theme.rs index e13edb05..6bd82a96 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -1102,21 +1102,19 @@ impl text_input::StyleSheet for Theme { let palette = self.extended_palette(); text_input::Appearance { - background: palette.background.base.color.into(), + background: palette.background.weak.color.into(), border_radius: 2.0, border_width: 1.0, - border_color: palette.background.weak.color, - icon_color: palette.background.weak.color, + border_color: palette.background.strong.color, + icon_color: palette.background.strong.color, } } fn disabled_color(&self, style: &Self::Style) -> Color { if let TextInput::Custom(custom) = style { - return custom.value_color(self); + return custom.disabled_color(self); } - let palette = self.extended_palette(); - - palette.secondary.strong.color + self.placeholder_color(style) } } -- cgit From de51bc3f41752634c0ccce8484d0a9bade62a45a Mon Sep 17 00:00:00 2001 From: Night_Hunter Date: Fri, 6 Jan 2023 14:55:09 +1300 Subject: Introduce left and right colors for slider rails --- style/src/slider.rs | 17 ++++++++++++++++- style/src/theme.rs | 14 ++++++++++---- 2 files changed, 26 insertions(+), 5 deletions(-) (limited to 'style/src') diff --git a/style/src/slider.rs b/style/src/slider.rs index 4b52fad3..c143915e 100644 --- a/style/src/slider.rs +++ b/style/src/slider.rs @@ -5,11 +5,26 @@ use iced_core::Color; #[derive(Debug, Clone, Copy)] pub struct Appearance { /// The colors of the rail of the slider. - pub rail_colors: (Color, Color), + pub rail: Rail, /// The appearance of the [`Handle`] of the slider. pub handle: Handle, } +/// The appearance of a slider rail +#[derive(Debug, Clone, Copy)] +pub struct Rail { + /// The colors of the rail of the slider. + pub colors: (Color, Color), + /// The height of a slider rail and the width of a vertical slider. + pub size: f32, + /// The border radius of the slider. + pub border_radius: f32, + /// The border width of the slider. + pub border_width: f32, + /// The border [`Color`] of the slider. + pub border_color: Color, +} + /// The appearance of the handle of a slider. #[derive(Debug, Clone, Copy)] pub struct Handle { diff --git a/style/src/theme.rs b/style/src/theme.rs index 6bd82a96..417680a1 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -416,10 +416,16 @@ impl slider::StyleSheet for Theme { }; slider::Appearance { - rail_colors: ( - palette.primary.base.color, - Color::TRANSPARENT, - ), + rail: slider::Rail { + colors: ( + palette.primary.base.color, + palette.primary.base.color, + ), + size: 2.0, + border_radius: 0.0, + border_width: 0.0, + border_color: Color::TRANSPARENT, + }, handle: slider::Handle { color: palette.background.base.color, border_color: palette.primary.base.color, -- cgit From c2cc9a835d8281c1d26c861ecac7991a924c3785 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 12 Apr 2023 05:21:46 +0200 Subject: Remove `border_width` support in `slider::Rail` --- style/src/slider.rs | 4 ---- style/src/theme.rs | 2 -- 2 files changed, 6 deletions(-) (limited to 'style/src') diff --git a/style/src/slider.rs b/style/src/slider.rs index c143915e..bb36a176 100644 --- a/style/src/slider.rs +++ b/style/src/slider.rs @@ -19,10 +19,6 @@ pub struct Rail { pub size: f32, /// The border radius of the slider. pub border_radius: f32, - /// The border width of the slider. - pub border_width: f32, - /// The border [`Color`] of the slider. - pub border_color: Color, } /// The appearance of the handle of a slider. diff --git a/style/src/theme.rs b/style/src/theme.rs index 417680a1..669d9157 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -423,8 +423,6 @@ impl slider::StyleSheet for Theme { ), size: 2.0, border_radius: 0.0, - border_width: 0.0, - border_color: Color::TRANSPARENT, }, handle: slider::Handle { color: palette.background.base.color, -- cgit From 6e6804c5c9d0dba921f2e25d2c888b136d22d35e Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 12 Apr 2023 05:25:27 +0200 Subject: Use a `border_radius` of `2.0` for slider rails in built-in theme --- style/src/theme.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'style/src') diff --git a/style/src/theme.rs b/style/src/theme.rs index 669d9157..2eb825e6 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -422,7 +422,7 @@ impl slider::StyleSheet for Theme { palette.primary.base.color, ), size: 2.0, - border_radius: 0.0, + border_radius: 2.0, }, handle: slider::Handle { color: palette.background.base.color, -- cgit From 9b39a17628e92b66ac3649e879478ed23635fa76 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 12 Apr 2023 05:27:32 +0200 Subject: Rename `Rail::size` to `width` --- style/src/slider.rs | 4 ++-- style/src/theme.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'style/src') diff --git a/style/src/slider.rs b/style/src/slider.rs index bb36a176..d5db1853 100644 --- a/style/src/slider.rs +++ b/style/src/slider.rs @@ -15,8 +15,8 @@ pub struct Appearance { pub struct Rail { /// The colors of the rail of the slider. pub colors: (Color, Color), - /// The height of a slider rail and the width of a vertical slider. - pub size: f32, + /// The width of the stroke of a slider rail. + pub width: f32, /// The border radius of the slider. pub border_radius: f32, } diff --git a/style/src/theme.rs b/style/src/theme.rs index 2eb825e6..b195940e 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -421,7 +421,7 @@ impl slider::StyleSheet for Theme { palette.primary.base.color, palette.primary.base.color, ), - size: 2.0, + width: 2.0, border_radius: 2.0, }, handle: slider::Handle { -- cgit From 52c84c4975d75baf313243d422d96581daca19bf Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 13 Apr 2023 05:53:40 +0200 Subject: Remove `border_radius` support for `slider::Rail` Our current quad shader may produce weird-looking results with non-integral scaling factors. --- style/src/slider.rs | 2 -- style/src/theme.rs | 1 - 2 files changed, 3 deletions(-) (limited to 'style/src') diff --git a/style/src/slider.rs b/style/src/slider.rs index d5db1853..884d3871 100644 --- a/style/src/slider.rs +++ b/style/src/slider.rs @@ -17,8 +17,6 @@ pub struct Rail { pub colors: (Color, Color), /// The width of the stroke of a slider rail. pub width: f32, - /// The border radius of the slider. - pub border_radius: f32, } /// The appearance of the handle of a slider. diff --git a/style/src/theme.rs b/style/src/theme.rs index b195940e..6711fd72 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -422,7 +422,6 @@ impl slider::StyleSheet for Theme { palette.primary.base.color, ), width: 2.0, - border_radius: 2.0, }, handle: slider::Handle { color: palette.background.base.color, -- cgit