diff options
author | 2024-03-19 22:09:36 +0900 | |
---|---|---|
committer | 2024-03-19 22:09:36 +0900 | |
commit | f3a1c785b2743e9c48c3d28df0c6772ce579d7c8 (patch) | |
tree | 1b39799f45878d89b4f9e2f9bea8fa8a7ed07150 /examples/styling/src/main.rs | |
parent | c9453cd55d84f0dd2ad0050208863d036c98843f (diff) | |
parent | 8ce16aba6204cb5c02a709cdf79c309f7b7e0196 (diff) | |
download | iced-f3a1c785b2743e9c48c3d28df0c6772ce579d7c8.tar.gz iced-f3a1c785b2743e9c48c3d28df0c6772ce579d7c8.tar.bz2 iced-f3a1c785b2743e9c48c3d28df0c6772ce579d7c8.zip |
Merge branch 'iced-rs:master' into viewer_content_fit
Diffstat (limited to 'examples/styling/src/main.rs')
-rw-r--r-- | examples/styling/src/main.rs | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index befdfc1b..73268da0 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -3,10 +3,12 @@ use iced::widget::{ progress_bar, row, scrollable, slider, text, text_input, toggler, vertical_rule, vertical_space, }; -use iced::{Alignment, Element, Length, Sandbox, Settings, Theme}; +use iced::{Alignment, Element, Length, Theme}; pub fn main() -> iced::Result { - Styling::run(Settings::default()) + iced::program("Styling - Iced", Styling::update, Styling::view) + .theme(Styling::theme) + .run() } #[derive(Default)] @@ -28,17 +30,7 @@ enum Message { TogglerToggled(bool), } -impl Sandbox for Styling { - type Message = Message; - - fn new() -> Self { - Styling::default() - } - - fn title(&self) -> String { - String::from("Styling - Iced") - } - +impl Styling { fn update(&mut self, message: Message) { match message { Message::ThemeChanged(theme) => { |