Support automatic style type casting for Buttons.

Changes the signature of Button::style to use `impl Into<...>` instead of taking the style sheet itself. (Matches other widgets).
This commit is contained in:
Nick 2023-08-21 13:32:44 -04:00 committed by Héctor Ramón Jiménez
parent 3b0d1b1ed4
commit aed06ac208
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -119,9 +119,9 @@ where
/// Sets the style variant of this [`Button`].
pub fn style(
mut self,
style: <Renderer::Theme as StyleSheet>::Style,
style: impl Into<<Renderer::Theme as StyleSheet>::Style>,
) -> Self {
self.style = style;
self.style = style.into();
self
}
}