diff options
author | 2024-03-24 05:03:09 +0100 | |
---|---|---|
committer | 2024-03-24 05:03:09 +0100 | |
commit | f0ae9a0c38c2532220a7460916604914db94c078 (patch) | |
tree | a1f0d1732108fa87ce4a63e76def9c38c8804d5d /examples/toast | |
parent | e657dc2ecd2ffa72c0abd87f9a59dcc1acbc7083 (diff) | |
download | iced-f0ae9a0c38c2532220a7460916604914db94c078.tar.gz iced-f0ae9a0c38c2532220a7460916604914db94c078.tar.bz2 iced-f0ae9a0c38c2532220a7460916604914db94c078.zip |
Use `Catalog` approach for all widgets
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) |