summaryrefslogtreecommitdiffstats
path: root/examples/game_of_life/src/style.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-06-07 04:51:44 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-06-07 04:51:44 +0200
commit396735b682433928f52ba777891e14f2fbc703c7 (patch)
treebd275980a2fe6bc2efa7288f08db007dcaa7b6a4 /examples/game_of_life/src/style.rs
parent97555e67af8b4bcc77df69c5e72156e14948150e (diff)
downloadiced-396735b682433928f52ba777891e14f2fbc703c7.tar.gz
iced-396735b682433928f52ba777891e14f2fbc703c7.tar.bz2
iced-396735b682433928f52ba777891e14f2fbc703c7.zip
Implement theme styling for `PickList` and `Menu`
Diffstat (limited to 'examples/game_of_life/src/style.rs')
-rw-r--r--examples/game_of_life/src/style.rs56
1 files changed, 0 insertions, 56 deletions
diff --git a/examples/game_of_life/src/style.rs b/examples/game_of_life/src/style.rs
deleted file mode 100644
index 69889889..00000000
--- a/examples/game_of_life/src/style.rs
+++ /dev/null
@@ -1,56 +0,0 @@
-use iced::{pick_list, Color};
-
-const BACKGROUND: Color = Color::from_rgb(
- 0x2F as f32 / 255.0,
- 0x31 as f32 / 255.0,
- 0x36 as f32 / 255.0,
-);
-
-pub struct PickList;
-
-impl pick_list::StyleSheet for PickList {
- fn menu(&self) -> pick_list::Menu {
- pick_list::Menu {
- text_color: Color::WHITE,
- background: BACKGROUND.into(),
- border_width: 1.0,
- border_color: Color {
- a: 0.7,
- ..Color::BLACK
- },
- selected_background: Color {
- a: 0.5,
- ..Color::BLACK
- }
- .into(),
- selected_text_color: Color::WHITE,
- }
- }
-
- fn active(&self) -> pick_list::Style {
- pick_list::Style {
- text_color: Color::WHITE,
- background: BACKGROUND.into(),
- border_width: 1.0,
- border_color: Color {
- a: 0.6,
- ..Color::BLACK
- },
- border_radius: 2.0,
- icon_size: 0.5,
- ..pick_list::Style::default()
- }
- }
-
- fn hovered(&self) -> pick_list::Style {
- let active = self.active();
-
- pick_list::Style {
- border_color: Color {
- a: 0.9,
- ..Color::BLACK
- },
- ..active
- }
- }
-}