summaryrefslogtreecommitdiffstats
path: root/examples/styling
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-10 08:15:05 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-10 10:01:51 +0100
commit3850a46db6e13f2948f5731f4ceec42764391f5d (patch)
tree032c2cf31412cbc87beef56b7654bbc1a1909c81 /examples/styling
parentd76705df29f1960124bd06277683448e18f788b0 (diff)
downloadiced-3850a46db6e13f2948f5731f4ceec42764391f5d.tar.gz
iced-3850a46db6e13f2948f5731f4ceec42764391f5d.tar.bz2
iced-3850a46db6e13f2948f5731f4ceec42764391f5d.zip
Add `Theme` selector to `layout` example
Diffstat (limited to 'examples/styling')
-rw-r--r--examples/styling/src/main.rs17
1 files changed, 10 insertions, 7 deletions
diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs
index f14f6a8f..10f3c79d 100644
--- a/examples/styling/src/main.rs
+++ b/examples/styling/src/main.rs
@@ -53,13 +53,16 @@ impl Sandbox for Styling {
self.theme = match theme {
ThemeType::Light => Theme::Light,
ThemeType::Dark => Theme::Dark,
- ThemeType::Custom => Theme::custom(theme::Palette {
- background: Color::from_rgb(1.0, 0.9, 1.0),
- text: Color::BLACK,
- primary: Color::from_rgb(0.5, 0.5, 0.0),
- success: Color::from_rgb(0.0, 1.0, 0.0),
- danger: Color::from_rgb(1.0, 0.0, 0.0),
- }),
+ ThemeType::Custom => Theme::custom(
+ String::from("Custom"),
+ theme::Palette {
+ background: Color::from_rgb(1.0, 0.9, 1.0),
+ text: Color::BLACK,
+ primary: Color::from_rgb(0.5, 0.5, 0.0),
+ success: Color::from_rgb(0.0, 1.0, 0.0),
+ danger: Color::from_rgb(1.0, 0.0, 0.0),
+ },
+ ),
}
}
Message::InputChanged(value) => self.input_value = value,