diff options
| author | 2022-10-07 16:58:45 -0700 | |
|---|---|---|
| committer | 2022-10-07 16:58:45 -0700 | |
| commit | aabc4e87b51af8025910681dc427260254877e4c (patch) | |
| tree | 44dc50e04e58c15871cc56d22221dc43685d1d58 /style | |
| parent | 7a124476b1f609019bb0fdfa1254236af2d2a49e (diff) | |
| parent | 77c838011fe6f8f567389d5994584a1a1b8420c5 (diff) | |
| download | iced-aabc4e87b51af8025910681dc427260254877e4c.tar.gz iced-aabc4e87b51af8025910681dc427260254877e4c.tar.bz2 iced-aabc4e87b51af8025910681dc427260254877e4c.zip | |
Merge branch 'master' into fear/linear-gradients
Diffstat (limited to '')
| -rw-r--r-- | style/src/radio.rs | 4 | ||||
| -rw-r--r-- | style/src/theme.rs | 14 | ||||
| -rw-r--r-- | style/src/toggler.rs | 2 | 
3 files changed, 14 insertions, 6 deletions
| diff --git a/style/src/radio.rs b/style/src/radio.rs index a4d4a83b..d14ea33e 100644 --- a/style/src/radio.rs +++ b/style/src/radio.rs @@ -15,7 +15,7 @@ pub struct Appearance {  pub trait StyleSheet {      type Style: Default + Copy; -    fn active(&self, style: Self::Style) -> Appearance; +    fn active(&self, style: Self::Style, is_selected: bool) -> Appearance; -    fn hovered(&self, style: Self::Style) -> Appearance; +    fn hovered(&self, style: Self::Style, is_selected: bool) -> Appearance;  } diff --git a/style/src/theme.rs b/style/src/theme.rs index 9e9abfa0..ea538c3a 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -415,7 +415,11 @@ impl pick_list::StyleSheet for Theme {  impl radio::StyleSheet for Theme {      type Style = (); -    fn active(&self, _style: Self::Style) -> radio::Appearance { +    fn active( +        &self, +        _style: Self::Style, +        _is_selected: bool, +    ) -> radio::Appearance {          let palette = self.extended_palette();          radio::Appearance { @@ -427,8 +431,12 @@ impl radio::StyleSheet for Theme {          }      } -    fn hovered(&self, style: Self::Style) -> radio::Appearance { -        let active = self.active(style); +    fn hovered( +        &self, +        style: Self::Style, +        is_selected: bool, +    ) -> radio::Appearance { +        let active = self.active(style, is_selected);          let palette = self.extended_palette();          radio::Appearance { diff --git a/style/src/toggler.rs b/style/src/toggler.rs index 4ee7db46..0acf8e97 100644 --- a/style/src/toggler.rs +++ b/style/src/toggler.rs @@ -2,7 +2,7 @@  use iced_core::Color;  /// The appearance of a toggler. -#[derive(Debug)] +#[derive(Debug, Clone, Copy)]  pub struct Appearance {      pub background: Color,      pub background_border: Option<Color>, | 
