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:
commit
c12d59db4b
1 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue