aboutsummaryrefslogtreecommitdiff
path: root/src/toggler.rs
diff options
context:
space:
mode:
authorPolesznyák Márk <contact@pml68.dev>2025-11-28 12:19:51 +0100
committerPolesznyák Márk <contact@pml68.dev>2025-11-30 01:58:04 +0100
commit9eb4a16495921ef65e3fb27277e64e8e9b7b2fd1 (patch)
treec7700a1ab1246c49911a09b3cbbd43b6416d21a1 /src/toggler.rs
parentfeat!: combine `Primary`, `Secondary`, `Tertiary` and `Error` (diff)
downloadiced_material-9eb4a16495921ef65e3fb27277e64e8e9b7b2fd1.tar.gz
chore: update as necessary for upstream iced changes
Diffstat (limited to '')
-rw-r--r--src/toggler.rs25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/toggler.rs b/src/toggler.rs
index 61e11a7..25730a2 100644
--- a/src/toggler.rs
+++ b/src/toggler.rs
@@ -29,7 +29,7 @@ pub fn styled(
background_border_width: if border.is_some() { 2.0 } else { 0.0 },
background_border_color: border.unwrap_or(Color::TRANSPARENT),
foreground,
- foreground_border_width: 0.0,
+ foreground_border_width: 2.0,
foreground_border_color: Color::TRANSPARENT,
text_color: Some(text_color),
}
@@ -68,11 +68,22 @@ pub fn default(theme: &Theme, status: Status) -> Style {
)
}
}
- Status::Disabled => styled(
- disabled_container(surface.container.highest),
- disabled_text(surface.text),
- surface.text,
- Some(disabled_text(surface.text)),
- ),
+ Status::Disabled { is_toggled } => {
+ if is_toggled {
+ styled(
+ disabled_container(surface.text),
+ disabled_text(surface.color),
+ surface.text,
+ None,
+ )
+ } else {
+ styled(
+ disabled_container(surface.container.highest),
+ disabled_text(surface.text),
+ surface.text,
+ Some(disabled_text(surface.text)),
+ )
+ }
+ }
}
}