Merge pull request #2775 from ellieplayswow/feature/hidden-scrollbar

Add in new convenience function for a hidden Scrollbar

Closes #2775.
This commit is contained in:
Héctor Ramón Jiménez 2025-11-21 00:02:01 +01:00
commit c12d59db4b
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -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<Pixels>) -> Self {
self.width = width.into().0.max(0.0);