diff options
author | 2022-07-09 02:28:52 +0200 | |
---|---|---|
committer | 2022-07-09 02:28:52 +0200 | |
commit | e053e25d2ccb17f7a162685a106a8bbd915a873f (patch) | |
tree | 5304f3ea2712e8889c7278ec5e57418f484d8f6c /examples/tooltip/src/main.rs | |
parent | 66eb6263003c1bbedd1fd14d6b12f172d20a6211 (diff) | |
parent | 7105db97a53d90adf429091298f31c90974d8f08 (diff) | |
download | iced-e053e25d2ccb17f7a162685a106a8bbd915a873f.tar.gz iced-e053e25d2ccb17f7a162685a106a8bbd915a873f.tar.bz2 iced-e053e25d2ccb17f7a162685a106a8bbd915a873f.zip |
Merge pull request #1362 from iced-rs/theming
Theming
Diffstat (limited to 'examples/tooltip/src/main.rs')
-rw-r--r-- | examples/tooltip/src/main.rs | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/examples/tooltip/src/main.rs b/examples/tooltip/src/main.rs index cfeaf6a6..1bd1133c 100644 --- a/examples/tooltip/src/main.rs +++ b/examples/tooltip/src/main.rs @@ -1,7 +1,9 @@ +use iced::alignment::{self, Alignment}; +use iced::button; +use iced::theme; use iced::tooltip::{self, Tooltip}; use iced::{ - alignment, button, Alignment, Button, Column, Container, Element, Length, - Row, Sandbox, Settings, Text, + Button, Column, Container, Element, Length, Row, Sandbox, Settings, Text, }; pub fn main() { @@ -115,24 +117,6 @@ fn tooltip<'a>( ) .gap(5) .padding(10) - .style(style::Tooltip) + .style(theme::Container::Box) .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() - } - } - } -} |