diff options
author | 2024-03-12 16:52:53 +0100 | |
---|---|---|
committer | 2024-03-12 16:52:53 +0100 | |
commit | 98621aa344a7a0e1b23f320d21a4687af559998e (patch) | |
tree | 4acb46e00ef3037aad6a8273ab67d4278d560784 /examples/gradient | |
parent | b721fd935c6b689b1365e21dfc864e43bf3a5895 (diff) | |
download | iced-98621aa344a7a0e1b23f320d21a4687af559998e.tar.gz iced-98621aa344a7a0e1b23f320d21a4687af559998e.tar.bz2 iced-98621aa344a7a0e1b23f320d21a4687af559998e.zip |
Remove `themer` use from `gradient` example :tada:
Diffstat (limited to 'examples/gradient')
-rw-r--r-- | examples/gradient/src/main.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/examples/gradient/src/main.rs b/examples/gradient/src/main.rs index 4a8b2fa5..8ed4c830 100644 --- a/examples/gradient/src/main.rs +++ b/examples/gradient/src/main.rs @@ -1,6 +1,6 @@ use iced::application; use iced::widget::{ - checkbox, column, container, horizontal_space, row, slider, text, themer, + checkbox, column, container, horizontal_space, row, slider, text, }; use iced::{gradient, window}; use iced::{ @@ -70,16 +70,16 @@ impl Sandbox for Gradient { transparent, } = *self; - let gradient = gradient::Linear::new(angle) - .add_stop(0.0, start) - .add_stop(1.0, end); + let gradient_box = container(horizontal_space()) + .style(move |_theme, _status| { + let gradient = gradient::Linear::new(angle) + .add_stop(0.0, start) + .add_stop(1.0, end); - let gradient_box = themer( - gradient, - container(horizontal_space()) - .width(Length::Fill) - .height(Length::Fill), - ); + gradient.into() + }) + .width(Length::Fill) + .height(Length::Fill); let angle_picker = row![ text("Angle").width(64), |