From 0f920e0435932c0b6927c771424b2ba495ddb46e Mon Sep 17 00:00:00 2001 From: dtzxporter Date: Tue, 6 Feb 2024 13:55:42 -0500 Subject: Introduce an appearance for a scrollable, ability to customize the scrollbar gap. Update scrollable.rs --- style/src/theme.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'style/src/theme.rs') diff --git a/style/src/theme.rs b/style/src/theme.rs index 5909498f..4579181b 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -1188,6 +1188,20 @@ impl Scrollable { impl scrollable::StyleSheet for Theme { type Style = Scrollable; + fn appearance(&self, style: &Self::Style) -> scrollable::Appearance { + match style { + Scrollable::Default => { + let palette = self.extended_palette(); + + scrollable::Appearance { + background: None, + gap: Some(palette.background.weak.color.into()), + } + } + Scrollable::Custom(custom) => custom.appearance(self), + } + } + fn active(&self, style: &Self::Style) -> scrollable::Scrollbar { match style { Scrollable::Default => { -- cgit