Skip to content

Commit

Permalink
Support automatic style type casting for Buttons.
Browse files Browse the repository at this point in the history
Changes the signature of Button::style to use `impl Into<...>` instead of taking the style sheet itself. (Matches other widgets).
  • Loading branch information
dtzxporter authored and hecrj committed Sep 3, 2023
1 parent 3b0d1b1 commit aed06ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions widget/src/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit aed06ac

Please sign in to comment.