diff options
author | 2024-02-06 13:55:42 -0500 | |
---|---|---|
committer | 2024-02-12 19:03:32 +0100 | |
commit | 0f920e0435932c0b6927c771424b2ba495ddb46e (patch) | |
tree | 36ff23cfa2ec6ec82457e521f8ebaad7a99ebc32 /style/src/theme.rs | |
parent | 891f29eea0cb32f0bee49fbace1757b82e1937f3 (diff) | |
download | iced-0f920e0435932c0b6927c771424b2ba495ddb46e.tar.gz iced-0f920e0435932c0b6927c771424b2ba495ddb46e.tar.bz2 iced-0f920e0435932c0b6927c771424b2ba495ddb46e.zip |
Introduce an appearance for a scrollable, ability to customize the scrollbar gap.
Update scrollable.rs
Diffstat (limited to '')
-rw-r--r-- | style/src/theme.rs | 14 |
1 files changed, 14 insertions, 0 deletions
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 => { |