diff options
author | 2023-09-03 09:10:16 +0200 | |
---|---|---|
committer | 2023-09-03 09:10:16 +0200 | |
commit | 2c51e3478bfb1c53ea7e63b1f1dc74ec46faa748 (patch) | |
tree | 53a3f74fc6ad7e50961d9cc768e521d07377a6b4 | |
parent | 404f4974a31b57469d70b4a94c99c2d4ec0600d2 (diff) | |
parent | 63c5f6278be8df17fc139dda1d41e0b26951509d (diff) | |
download | iced-2c51e3478bfb1c53ea7e63b1f1dc74ec46faa748.tar.gz iced-2c51e3478bfb1c53ea7e63b1f1dc74ec46faa748.tar.bz2 iced-2c51e3478bfb1c53ea7e63b1f1dc74ec46faa748.zip |
Merge pull request #2046 from dtzxporter/dtzxporter-patch-1
Support automatic style type casting for Buttons.
Diffstat (limited to '')
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | widget/src/button.rs | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 68713158..fd930a36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Updated `wgpu` to `0.17`. [#2065](https://github.com/iced-rs/iced/pull/2065) +- Changed `Button::style` to take an `impl Into<...>` for consistency. [#2046](https://github.com/iced-rs/iced/pull/2046) ### Fixed - Missing `width` attribute in `styling` example. [#2062](https://github.com/iced-rs/iced/pull/2062) @@ -17,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Many thanks to... - @akshayr-mecha +- @dtzxporter ## [0.10.0] - 2023-07-28 ### Added 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 } } |