summaryrefslogtreecommitdiffstats
path: root/widget/src/button.rs
diff options
context:
space:
mode:
authorLibravatar Nick <dtzxporter@users.noreply.github.com>2023-08-21 13:32:44 -0400
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-09-03 08:38:49 +0200
commitaed06ac208d1e80b13c5952adbff78dd7d02c025 (patch)
treef26dc589426cace68404c647e84e5b314d813ab0 /widget/src/button.rs
parent3b0d1b1ed4226d53f63e39550a446c784d5f4199 (diff)
downloadiced-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.rs4
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
}
}