From fd1d9654b0c0cf6fad3064ad8f1a5a319bff535e Mon Sep 17 00:00:00 2001 From: ellieplayswow <164806095+ellieplayswow@users.noreply.github.com> Date: Sat, 1 Feb 2025 00:21:41 +0000 Subject: [PATCH] Add in new convenience function for a hidden Scrollbar --- widget/src/scrollable.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/widget/src/scrollable.rs b/widget/src/scrollable.rs index 420ae88e..a10ee771 100644 --- a/widget/src/scrollable.rs +++ b/widget/src/scrollable.rs @@ -332,6 +332,12 @@ impl Scrollbar { Self::default() } + /// Create a [`Scrollbar`] with zero width to allow a [`Scrollable`] to scroll without a visible + /// scroller. + pub fn hidden() -> Self { + Self::default().width(0).scroller_width(0) + } + /// Sets the scrollbar width of the [`Scrollbar`] . pub fn width(mut self, width: impl Into) -> Self { self.width = width.into().0.max(0.0);