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:
parent
3b0d1b1ed4
commit
aed06ac208
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue