summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-07 20:16:07 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-07 20:16:07 +0100
commitb8f05eb8dd0394e308385796c229cfc5bc4f3a73 (patch)
tree0641cd79284656bd2c0f6c8890337d1055a846fe
parent34ca5386b52ae56d7373ce1af7933cf9aa104b08 (diff)
downloadiced-b8f05eb8dd0394e308385796c229cfc5bc4f3a73.tar.gz
iced-b8f05eb8dd0394e308385796c229cfc5bc4f3a73.tar.bz2
iced-b8f05eb8dd0394e308385796c229cfc5bc4f3a73.zip
Implement `button::DefaultStyle` for `Color`
-rw-r--r--widget/src/button.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/widget/src/button.rs b/widget/src/button.rs
index bfda8fe3..12716acd 100644
--- a/widget/src/button.rs
+++ b/widget/src/button.rs
@@ -454,6 +454,12 @@ impl DefaultStyle for Appearance {
}
}
+impl DefaultStyle for Color {
+ fn default_style() -> Style<Self> {
+ |color, _status| Appearance::with_background(*color)
+ }
+}
+
/// A primary button; denoting a main action.
pub fn primary(theme: &Theme, status: Status) -> Appearance {
let palette = theme.extended_palette();