Wire up container styling to iced_native

This commit is contained in:
Héctor Ramón Jiménez 2021-10-18 15:36:32 +07:00
parent edea093350
commit d61cb58d92
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
17 changed files with 65 additions and 99 deletions

View file

@ -17,7 +17,7 @@ pub struct TitleBar<'a, Message, Renderer: pane_grid::Renderer> {
controls: Option<Element<'a, Message, Renderer>>,
padding: Padding,
always_show_controls: bool,
style: <Renderer as container::Renderer>::Style,
style: &'a dyn container::StyleSheet,
}
impl<'a, Message, Renderer> TitleBar<'a, Message, Renderer>
@ -54,11 +54,8 @@ where
}
/// Sets the style of the [`TitleBar`].
pub fn style(
mut self,
style: impl Into<<Renderer as container::Renderer>::Style>,
) -> Self {
self.style = style.into();
pub fn style(mut self, style: &'a dyn container::StyleSheet) -> Self {
self.style = style;
self
}