diff options
author | 2021-02-23 04:00:35 +0100 | |
---|---|---|
committer | 2021-02-23 04:00:35 +0100 | |
commit | 4e923290ccb38dc9cee05592554f98f1f0f12966 (patch) | |
tree | 762426ef3cd8bd53c8791463d09a2674721df601 /examples/tooltip | |
parent | 9d4996cbab012559c73852145b9968f6b101663a (diff) | |
download | iced-4e923290ccb38dc9cee05592554f98f1f0f12966.tar.gz iced-4e923290ccb38dc9cee05592554f98f1f0f12966.tar.bz2 iced-4e923290ccb38dc9cee05592554f98f1f0f12966.zip |
Add `style` and `padding` to `Tooltip`
Diffstat (limited to 'examples/tooltip')
-rw-r--r-- | examples/tooltip/src/main.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/tooltip/src/main.rs b/examples/tooltip/src/main.rs index 3677dc75..b10b8b50 100644 --- a/examples/tooltip/src/main.rs +++ b/examples/tooltip/src/main.rs @@ -114,5 +114,25 @@ fn tooltip<'a>( position, ) .gap(10) + .padding(20) + .style(style::Tooltip) .into() } + +mod style { + use iced::container; + use iced::Color; + + pub struct Tooltip; + + impl container::StyleSheet for Tooltip { + fn style(&self) -> container::Style { + container::Style { + text_color: Some(Color::from_rgb8(0xEE, 0xEE, 0xEE)), + background: Some(Color::from_rgb(0.11, 0.42, 0.87).into()), + border_radius: 12.0, + ..container::Style::default() + } + } + } +} |