Leverage DefaultStyle traits instead of Default

This commit is contained in:
Héctor Ramón Jiménez 2024-03-07 20:11:32 +01:00
parent 44f002f64a
commit 833538ee7f
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
30 changed files with 393 additions and 437 deletions

View file

@ -37,14 +37,14 @@ where
content: impl Into<Element<'a, Message, Theme, Renderer>>,
) -> Self
where
container::Style<Theme>: Default,
Theme: container::DefaultStyle,
{
Self {
content: content.into(),
controls: None,
padding: Padding::ZERO,
always_show_controls: false,
style: container::Style::default(),
style: Theme::default_style(),
}
}
@ -138,7 +138,7 @@ where
container::Status::Idle
};
self.style.resolve(theme, status)
(self.style)(theme, status)
};
let inherited_style = renderer::Style {