diff options
author | 2023-08-21 13:32:44 -0400 | |
---|---|---|
committer | 2023-09-03 08:38:49 +0200 | |
commit | aed06ac208d1e80b13c5952adbff78dd7d02c025 (patch) | |
tree | f26dc589426cace68404c647e84e5b314d813ab0 /widget/src/button.rs | |
parent | 3b0d1b1ed4226d53f63e39550a446c784d5f4199 (diff) | |
download | iced-aed06ac208d1e80b13c5952adbff78dd7d02c025.tar.gz iced-aed06ac208d1e80b13c5952adbff78dd7d02c025.tar.bz2 iced-aed06ac208d1e80b13c5952adbff78dd7d02c025.zip |
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).
Diffstat (limited to 'widget/src/button.rs')
-rw-r--r-- | widget/src/button.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/widget/src/button.rs b/widget/src/button.rs index 5727c631..18a95c9e 100644 --- a/widget/src/button.rs +++ b/widget/src/button.rs @@ -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 } } |