diff options
| author | Polesznyák Márk <contact@pml68.dev> | 2025-11-22 08:30:00 +0100 |
|---|---|---|
| committer | Polesznyák Márk <contact@pml68.dev> | 2025-11-22 08:30:00 +0100 |
| commit | ff7e17988d5868c72cfb39d09ccf4efb05d3ceda (patch) | |
| tree | 0734e0f409028e203532bfaea2c7372e2c646078 /src/button.rs | |
| parent | chore: add mailmap (diff) | |
| download | iced_material-ff7e17988d5868c72cfb39d09ccf4efb05d3ceda.tar.gz | |
feat!: combine `Primary`, `Secondary`, `Tertiary` and `Error`
Now only a singular `ColorQuartet` struct exists.
Also rename some `Surface` and `Inverse` fields for consistency.
Diffstat (limited to '')
| -rw-r--r-- | src/button.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/button.rs b/src/button.rs index 7a35e10..3b2d871 100644 --- a/src/button.rs +++ b/src/button.rs @@ -70,8 +70,8 @@ pub fn elevated(theme: &Theme, status: Status) -> Style { let surface = theme.colors().surface; let foreground = theme.colors().primary.color; - let background = surface.surface_container.low; - let disabled = surface.on_surface; + let background = surface.container.low; + let disabled = surface.text; let shadow_color = theme.colors().shadow; @@ -81,9 +81,9 @@ pub fn elevated(theme: &Theme, status: Status) -> Style { pub fn filled(theme: &Theme, status: Status) -> Style { let primary = theme.colors().primary; - let foreground = primary.on_primary; + let foreground = primary.text; let background = primary.color; - let disabled = theme.colors().surface.on_surface; + let disabled = theme.colors().surface.text; let shadow_color = theme.colors().shadow; @@ -93,9 +93,9 @@ pub fn filled(theme: &Theme, status: Status) -> Style { pub fn filled_tonal(theme: &Theme, status: Status) -> Style { let secondary = theme.colors().secondary; - let foreground = secondary.on_secondary_container; - let background = secondary.secondary_container; - let disabled = theme.colors().surface.on_surface; + let foreground = secondary.container_text; + let background = secondary.container; + let disabled = theme.colors().surface.text; let shadow_color = theme.colors().shadow; styled(background, foreground, disabled, shadow_color, 0, status) @@ -104,7 +104,7 @@ pub fn filled_tonal(theme: &Theme, status: Status) -> Style { pub fn outlined(theme: &Theme, status: Status) -> Style { let foreground = theme.colors().primary.color; let background = Color::TRANSPARENT; - let disabled = theme.colors().surface.on_surface; + let disabled = theme.colors().surface.text; let outline = theme.colors().outline.color; @@ -136,7 +136,7 @@ pub fn outlined(theme: &Theme, status: Status) -> Style { pub fn text(theme: &Theme, status: Status) -> Style { let foreground = theme.colors().primary.color; let background = Color::TRANSPARENT; - let disabled = theme.colors().surface.on_surface; + let disabled = theme.colors().surface.text; let style = styled( background, |
