summaryrefslogtreecommitdiffstats
path: root/examples/tour.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-30 12:14:26 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-30 12:14:26 +0100
commit8caa66be2708b1c83e20d905d69902c2567c4692 (patch)
treeee18296fc3d32f24bca90f97fc6845d97f3e4c21 /examples/tour.rs
parent89a6b8a9a173e767753ec777fd83c912c1be5ea3 (diff)
downloadiced-8caa66be2708b1c83e20d905d69902c2567c4692.tar.gz
iced-8caa66be2708b1c83e20d905d69902c2567c4692.tar.bz2
iced-8caa66be2708b1c83e20d905d69902c2567c4692.zip
Add `Renderer::Defaults` and style inheritance
Diffstat (limited to 'examples/tour.rs')
-rw-r--r--examples/tour.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/examples/tour.rs b/examples/tour.rs
index 402bf1c4..2429ca4f 100644
--- a/examples/tour.rs
+++ b/examples/tour.rs
@@ -694,9 +694,7 @@ fn button<'a, Message>(
) -> Button<'a, Message> {
Button::new(
state,
- Text::new(label)
- .color(Color::WHITE)
- .horizontal_alignment(HorizontalAlignment::Center),
+ Text::new(label).horizontal_alignment(HorizontalAlignment::Center),
)
.padding(12)
.min_width(100)
@@ -761,6 +759,15 @@ mod style {
})),
border_radius: 12,
shadow_offset: 1.0,
+ text_color: Color::from_rgb8(0xEE, 0xEE, 0xEE),
+ }
+ }
+
+ fn hovered(&self) -> button::Style {
+ button::Style {
+ text_color: Color::WHITE,
+ shadow_offset: 2.0,
+ ..self.active()
}
}
}