diff --git a/src/gui/style.rs b/src/gui/style.rs index dae2d50..0465523 100644 --- a/src/gui/style.rs +++ b/src/gui/style.rs @@ -285,7 +285,7 @@ impl checkbox::StyleSheet for SelectionCheckBox { border_radius: 5.0, border_width: 1.0, border_color: palette.base.background, - text_color: Color::BLACK, + text_color: palette.bright.surface, }, Self::Disabled(palette) => checkbox::Style { background: Background::Color(palette.base.foreground), @@ -293,7 +293,7 @@ impl checkbox::StyleSheet for SelectionCheckBox { border_radius: 5.0, border_width: 1.0, border_color: palette.normal.primary, - text_color: Color::BLACK, + text_color: palette.bright.surface, }, } } @@ -306,7 +306,7 @@ impl checkbox::StyleSheet for SelectionCheckBox { border_radius: 5.0, border_width: 2.0, border_color: palette.normal.primary, - text_color: Color::BLACK, + text_color: palette.bright.surface, }, Self::Disabled(_) => checkbox::Style { @@ -316,6 +316,31 @@ impl checkbox::StyleSheet for SelectionCheckBox { } } +pub struct SettingsCheckbox(pub ColorPalette); +impl checkbox::StyleSheet for SettingsCheckbox { + fn active(&self, _is_checked: bool) -> checkbox::Style { + checkbox::Style { + background: Background::Color(self.0.base.background), + checkmark_color: self.0.bright.primary, + border_radius: 5.0, + border_width: 1.0, + border_color: self.0.bright.primary, + text_color: self.0.bright.surface, + } + } + + fn hovered(&self, _is_checked: bool) -> checkbox::Style { + checkbox::Style { + background: Background::Color(self.0.base.foreground), + checkmark_color: self.0.bright.primary, + border_radius: 5.0, + border_width: 2.0, + border_color: self.0.bright.primary, + text_color: self.0.bright.surface, + } + } +} + pub struct SearchInput(pub ColorPalette); impl text_input::StyleSheet for SearchInput { fn active(&self) -> text_input::Style { diff --git a/src/gui/views/settings.rs b/src/gui/views/settings.rs index 1a351bd..b3b26d0 100644 --- a/src/gui/views/settings.rs +++ b/src/gui/views/settings.rs @@ -101,7 +101,8 @@ impl Settings { self.phone.expert_mode, "Allow to uninstall packages marked as \"unsafe\" (I KNOW WHAT I AM DOING)", Message::ExpertMode, - ); + ) + .style(style::SettingsCheckbox(self.theme.palette)); let disable_mode_descr = Text::new("Default mode on older phone (< Android 8.0) where uninstalled packages can't be restored.") .size(15) @@ -111,7 +112,8 @@ impl Settings { self.phone.disable_mode, "Clear and disable packages instead of uninstalling them", Message::DisableMode, - ); + ) + .style(style::SettingsCheckbox(self.theme.palette)); let multi_user_mode_descr = Text::new("Disabling this setting will typically prevent affecting your work profile") @@ -122,7 +124,8 @@ impl Settings { self.phone.multi_user_mode, "Affect all the users of the phone (not only the selected user)", Message::MultiUserMode, - ); + ) + .style(style::SettingsCheckbox(self.theme.palette)); let content = Column::new() .width(Length::Fill)