diff options
Diffstat (limited to 'widget')
-rw-r--r-- | widget/src/button.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/widget/src/button.rs b/widget/src/button.rs index f9859353..bfda8fe3 100644 --- a/widget/src/button.rs +++ b/widget/src/button.rs @@ -411,6 +411,16 @@ pub struct Appearance { pub shadow: Shadow, } +impl Appearance { + /// Creates an [`Appearance`] with the given [`Background`]. + pub fn with_background(background: impl Into<Background>) -> Self { + Self { + background: Some(background.into()), + ..Self::default() + } + } +} + impl std::default::Default for Appearance { fn default() -> Self { Self { |