aboutsummaryrefslogtreecommitdiff
path: root/src/toggler.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/toggler.rs')
-rw-r--r--src/toggler.rs19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/toggler.rs b/src/toggler.rs
index 5cebc88..cf2aa1d 100644
--- a/src/toggler.rs
+++ b/src/toggler.rs
@@ -21,6 +21,7 @@ impl Catalog for Theme {
pub fn styled(
background: Color,
foreground: Color,
+ text_color: Color,
border: Option<Color>,
) -> Style {
Style {
@@ -30,6 +31,7 @@ pub fn styled(
foreground,
foreground_border_width: 0.0,
foreground_border_color: Color::TRANSPARENT,
+ text_color: Some(text_color),
}
}
@@ -40,18 +42,29 @@ pub fn default(theme: &Theme, status: Status) -> Style {
match status {
Status::Active { is_toggled } => {
if is_toggled {
- styled(primary.color, primary.on_primary, None)
+ styled(
+ primary.color,
+ primary.on_primary,
+ surface.on_surface,
+ None,
+ )
} else {
styled(
surface.surface_container.highest,
theme.colors().outline.color,
+ surface.on_surface,
Some(theme.colors().outline.color),
)
}
}
Status::Hovered { is_toggled } => {
if is_toggled {
- styled(primary.color, primary.primary_container, None)
+ styled(
+ primary.color,
+ primary.primary_container,
+ surface.on_surface,
+ None,
+ )
} else {
styled(
mix(
@@ -60,6 +73,7 @@ pub fn default(theme: &Theme, status: Status) -> Style {
HOVERED_LAYER_OPACITY,
),
surface.on_surface_variant,
+ surface.on_surface,
Some(theme.colors().outline.color),
)
}
@@ -67,6 +81,7 @@ pub fn default(theme: &Theme, status: Status) -> Style {
Status::Disabled => styled(
disabled_container(surface.surface_container.highest),
disabled_text(surface.on_surface),
+ surface.on_surface,
Some(disabled_text(surface.on_surface)),
),
}