diff --git a/widget/src/button.rs b/widget/src/button.rs index 85f16f59..6227f499 100644 --- a/widget/src/button.rs +++ b/widget/src/button.rs @@ -688,6 +688,29 @@ pub fn text(theme: &Theme, status: Status) -> Style { } } +/// A subtle button using background shades. +pub fn subtle(theme: &Theme, status: Status) -> Style { + let palette = theme.extended_palette(); + let base = styled(palette.background.weakest); + + match status { + Status::Active => base, + Status::Pressed => Style { + background: Some(Background::Color( + palette.background.strongest.color, + )), + ..base + }, + Status::Hovered => Style { + background: Some(Background::Color( + palette.background.strong.color, + )), + ..base + }, + Status::Disabled => disabled(base), + } +} + fn styled(pair: palette::Pair) -> Style { Style { background: Some(Background::Color(pair.color)),