From a1122f07549dfd1a3f57fb5cd5c1bdb861dfa6c6 Mon Sep 17 00:00:00 2001 From: B0ney <40839054+B0ney@users.noreply.github.com> Date: Sat, 20 Sep 2025 19:01:25 +0100 Subject: [PATCH] scrollable: have scroller use `Background` instead of `Color` --- widget/src/scrollable.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/widget/src/scrollable.rs b/widget/src/scrollable.rs index 1d760e32..91d6c02b 100644 --- a/widget/src/scrollable.rs +++ b/widget/src/scrollable.rs @@ -1230,7 +1230,8 @@ where if let Some(scroller) = scrollbar.scroller && scroller.bounds.width > 0.0 && scroller.bounds.height > 0.0 - && (style.scroller.color != Color::TRANSPARENT + && (style.scroller.background + != Background::Color(Color::TRANSPARENT) || (style.scroller.border.color != Color::TRANSPARENT && style.scroller.border.width > 0.0)) @@ -1241,7 +1242,7 @@ where border: style.scroller.border, ..renderer::Quad::default() }, - style.scroller.color, + style.scroller.background, ); } }; @@ -2294,8 +2295,8 @@ pub struct Rail { /// The appearance of the scroller of a scrollable. #[derive(Debug, Clone, Copy, PartialEq)] pub struct Scroller { - /// The [`Color`] of the scroller. - pub color: Color, + /// The [`Background`] of the scroller. + pub background: Background, /// The [`Border`] of the scroller. pub border: Border, } @@ -2348,7 +2349,7 @@ pub fn default(theme: &Theme, status: Status) -> Style { background: Some(palette.background.weak.color.into()), border: border::rounded(2), scroller: Scroller { - color: palette.background.strongest.color, + background: palette.background.strongest.color.into(), border: border::rounded(2), }, }; @@ -2381,7 +2382,7 @@ pub fn default(theme: &Theme, status: Status) -> Style { } => { let hovered_scrollbar = Rail { scroller: Scroller { - color: palette.primary.strong.color, + background: palette.primary.strong.color.into(), ..scrollbar.scroller }, ..scrollbar @@ -2410,7 +2411,7 @@ pub fn default(theme: &Theme, status: Status) -> Style { } => { let dragged_scrollbar = Rail { scroller: Scroller { - color: palette.primary.base.color, + background: palette.primary.base.color.into(), ..scrollbar.scroller }, ..scrollbar