summaryrefslogtreecommitdiffstats
path: root/examples/gradient
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-12-06 04:06:41 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-12-10 04:51:08 +0100
commit1aeb317f2dbfb63215e6226073e67878ffa6503b (patch)
treed883266d796360a1e4d883dc82a4fb284f724790 /examples/gradient
parent8e3636d769d96ab5ba49a9647b72c59ae2226dd0 (diff)
downloadiced-1aeb317f2dbfb63215e6226073e67878ffa6503b.tar.gz
iced-1aeb317f2dbfb63215e6226073e67878ffa6503b.tar.bz2
iced-1aeb317f2dbfb63215e6226073e67878ffa6503b.zip
Add image and hash snapshot-based testing to `iced_test`
Diffstat (limited to 'examples/gradient')
-rw-r--r--examples/gradient/src/main.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/examples/gradient/src/main.rs b/examples/gradient/src/main.rs
index b2de069f..910ea9fc 100644
--- a/examples/gradient/src/main.rs
+++ b/examples/gradient/src/main.rs
@@ -1,5 +1,5 @@
-use iced::application;
use iced::gradient;
+use iced::theme;
use iced::widget::{
checkbox, column, container, horizontal_space, row, slider, text,
};
@@ -95,16 +95,14 @@ impl Gradient {
.into()
}
- fn style(&self, theme: &Theme) -> application::Appearance {
- use application::DefaultStyle;
-
+ fn style(&self, theme: &Theme) -> theme::Style {
if self.transparent {
- application::Appearance {
+ theme::Style {
background_color: Color::TRANSPARENT,
text_color: theme.palette().text,
}
} else {
- Theme::default_style(theme)
+ theme::default(theme)
}
}
}