Add image and hash snapshot-based testing to iced_test

This commit is contained in:
Héctor Ramón Jiménez 2024-12-06 04:06:41 +01:00
parent 8e3636d769
commit 1aeb317f2d
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
17 changed files with 280 additions and 105 deletions

View file

@ -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)
}
}
}