From 3e643a9d6b904bcb46f94d2961d911deea915cf1 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 8 Jul 2022 20:23:38 +0200 Subject: Fix inconsistent styling for `Radio` and `Checkbox` --- style/src/theme.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'style/src') diff --git a/style/src/theme.rs b/style/src/theme.rs index 70b32edf..d2de8a5d 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -171,21 +171,25 @@ impl checkbox::StyleSheet for Theme { match style { Checkbox::Primary => checkbox_appearance( + palette.primary.strong.text, palette.background.base, palette.primary.strong, is_checked, ), Checkbox::Secondary => checkbox_appearance( + palette.background.base.text, palette.background.base, palette.background.base, is_checked, ), Checkbox::Success => checkbox_appearance( + palette.success.base.text, palette.background.base, palette.success.base, is_checked, ), Checkbox::Danger => checkbox_appearance( + palette.danger.base.text, palette.background.base, palette.danger.base, is_checked, @@ -202,21 +206,25 @@ impl checkbox::StyleSheet for Theme { match style { Checkbox::Primary => checkbox_appearance( + palette.primary.strong.text, palette.background.weak, palette.primary.base, is_checked, ), Checkbox::Secondary => checkbox_appearance( + palette.background.base.text, palette.background.weak, palette.background.base, is_checked, ), Checkbox::Success => checkbox_appearance( + palette.success.base.text, palette.background.weak, palette.success.base, is_checked, ), Checkbox::Danger => checkbox_appearance( + palette.danger.base.text, palette.background.weak, palette.danger.base, is_checked, @@ -226,6 +234,7 @@ impl checkbox::StyleSheet for Theme { } fn checkbox_appearance( + checkmark_color: Color, base: palette::Pair, accent: palette::Pair, is_checked: bool, @@ -236,7 +245,7 @@ fn checkbox_appearance( } else { base.color }), - checkmark_color: accent.text, + checkmark_color, border_radius: 2.0, border_width: 1.0, border_color: accent.color, @@ -422,7 +431,7 @@ impl radio::StyleSheet for Theme { let palette = self.extended_palette(); radio::Appearance { - dot_color: palette.primary.weak.text.into(), + dot_color: palette.primary.strong.color.into(), background: palette.primary.weak.color.into(), ..active } -- cgit