From e92ea48e8814b42fc566017db085ca9bdaf3c272 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 5 Dec 2019 01:57:35 +0100 Subject: Make `Button::background` generic --- native/CHANGELOG.md | 1 + native/src/widget/button.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'native') diff --git a/native/CHANGELOG.md b/native/CHANGELOG.md index 2a4bba3f..cf5b79dd 100644 --- a/native/CHANGELOG.md +++ b/native/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - `Image::new` takes an `Into` now instead of an `Into`. [#90] +- `Button::background` takes an `Into` now instead of a `Background`. ### Fixed - `Image` widget not keeping aspect ratio consistently. [#90] diff --git a/native/src/widget/button.rs b/native/src/widget/button.rs index 023c4ee8..3348c58c 100644 --- a/native/src/widget/button.rs +++ b/native/src/widget/button.rs @@ -89,8 +89,8 @@ impl<'a, Message, Renderer> Button<'a, Message, Renderer> { /// /// [`Button`]: struct.Button.html /// [`Background`]: ../../struct.Background.html - pub fn background(mut self, background: Background) -> Self { - self.background = Some(background); + pub fn background>(mut self, background: T) -> Self { + self.background = Some(background.into()); self } -- cgit