summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-05 01:57:35 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-05 01:57:35 +0100
commite92ea48e8814b42fc566017db085ca9bdaf3c272 (patch)
tree48413064237f8b00b4b4c8668a96fc5ca79d995a /web
parentf87ddf1056327551b4a2bba9e98cbb7816b6666c (diff)
downloadiced-e92ea48e8814b42fc566017db085ca9bdaf3c272.tar.gz
iced-e92ea48e8814b42fc566017db085ca9bdaf3c272.tar.bz2
iced-e92ea48e8814b42fc566017db085ca9bdaf3c272.zip
Make `Button::background` generic
Diffstat (limited to 'web')
-rw-r--r--web/CHANGELOG.md3
-rw-r--r--web/src/widget/button.rs4
2 files changed, 5 insertions, 2 deletions
diff --git a/web/CHANGELOG.md b/web/CHANGELOG.md
index 0bdb9c37..ed02519a 100644
--- a/web/CHANGELOG.md
+++ b/web/CHANGELOG.md
@@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
+### Changed
+- `Button::background` takes an `Into<Background>` now instead of a `Background`.
+
### Fixed
- Render not being scheduled after `Command` futures finishing.
diff --git a/web/src/widget/button.rs b/web/src/widget/button.rs
index 889c0ab1..4cc8b3de 100644
--- a/web/src/widget/button.rs
+++ b/web/src/widget/button.rs
@@ -81,8 +81,8 @@ impl<'a, Message> Button<'a, Message> {
///
/// [`Button`]: struct.Button.html
/// [`Background`]: ../../struct.Background.html
- pub fn background(mut self, background: Background) -> Self {
- self.background = Some(background);
+ pub fn background<T: Into<Background>>(mut self, background: T) -> Self {
+ self.background = Some(background.into());
self
}