diff options
| author | 2024-03-07 20:16:07 +0100 | |
|---|---|---|
| committer | 2024-03-07 20:16:07 +0100 | |
| commit | b8f05eb8dd0394e308385796c229cfc5bc4f3a73 (patch) | |
| tree | 0641cd79284656bd2c0f6c8890337d1055a846fe | |
| parent | 34ca5386b52ae56d7373ce1af7933cf9aa104b08 (diff) | |
| download | iced-b8f05eb8dd0394e308385796c229cfc5bc4f3a73.tar.gz iced-b8f05eb8dd0394e308385796c229cfc5bc4f3a73.tar.bz2 iced-b8f05eb8dd0394e308385796c229cfc5bc4f3a73.zip  | |
Implement `button::DefaultStyle` for `Color`
| -rw-r--r-- | widget/src/button.rs | 6 | 
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();  | 
