diff options
author | 2024-03-25 22:21:22 +0100 | |
---|---|---|
committer | 2024-03-25 22:21:22 +0100 | |
commit | eae4065300e9997db12268be55eceb4e4c294b1e (patch) | |
tree | 677326f37ac8bbf922c18369d0f1d4955852fb18 /examples/toast | |
parent | a2a8381a49ac2dd1cd65eb382b9ee02bbfa17286 (diff) | |
parent | 74373cb086da6097eae7d2e8bd6348aaf7c43857 (diff) | |
download | iced-eae4065300e9997db12268be55eceb4e4c294b1e.tar.gz iced-eae4065300e9997db12268be55eceb4e4c294b1e.tar.bz2 iced-eae4065300e9997db12268be55eceb4e4c294b1e.zip |
Merge pull request #2350 from iced-rs/theming-revolutions
Theming Revolutions
Diffstat (limited to 'examples/toast')
-rw-r--r-- | examples/toast/src/main.rs | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/examples/toast/src/main.rs b/examples/toast/src/main.rs index fdae1dc1..9968962c 100644 --- a/examples/toast/src/main.rs +++ b/examples/toast/src/main.rs @@ -651,45 +651,33 @@ mod toast { } } - fn styled(pair: theme::palette::Pair) -> container::Appearance { - container::Appearance { + fn styled(pair: theme::palette::Pair) -> container::Style { + container::Style { background: Some(pair.color.into()), text_color: pair.text.into(), ..Default::default() } } - fn primary( - theme: &Theme, - _status: container::Status, - ) -> container::Appearance { + fn primary(theme: &Theme) -> container::Style { let palette = theme.extended_palette(); styled(palette.primary.weak) } - fn secondary( - theme: &Theme, - _status: container::Status, - ) -> container::Appearance { + fn secondary(theme: &Theme) -> container::Style { let palette = theme.extended_palette(); styled(palette.secondary.weak) } - fn success( - theme: &Theme, - _status: container::Status, - ) -> container::Appearance { + fn success(theme: &Theme) -> container::Style { let palette = theme.extended_palette(); styled(palette.success.weak) } - fn danger( - theme: &Theme, - _status: container::Status, - ) -> container::Appearance { + fn danger(theme: &Theme) -> container::Style { let palette = theme.extended_palette(); styled(palette.danger.weak) |