pub struct ScrollbarSpec {
pub thickness: f32,
pub min_thumb_extent: f32,
pub corner_radius: Option<f32>,
pub colors: ScrollbarColors,
pub hide_when_content_fits: bool,
}Expand description
How a Scrollbar is drawn and how short its thumb may get.
Fields§
§thickness: f32Width across the short axis.
min_thumb_extent: f32The shortest the thumb may get, in logical pixels.
corner_radius: Option<f32>Corner radius of the track and the thumb. Defaults to a full pill.
colors: ScrollbarColorsColors of the track and the thumb.
hide_when_content_fits: boolWhether the bar disappears entirely when the content fits.
A bar left visible over content that cannot scroll invites a drag that does nothing.
Implementations§
Source§impl ScrollbarSpec
impl ScrollbarSpec
Sourcepub fn thickness(self, thickness: f32) -> Self
pub fn thickness(self, thickness: f32) -> Self
Sets the width across the short axis, in logical pixels. Negative values count as zero.
Sourcepub fn min_thumb_extent(self, extent: f32) -> Self
pub fn min_thumb_extent(self, extent: f32) -> Self
Sets the shortest the thumb may get, in logical pixels. Negative values count as zero.
Sourcepub fn corner_radius(self, radius: f32) -> Self
pub fn corner_radius(self, radius: f32) -> Self
Sets the corner radius of the track and the thumb, in logical pixels. Negative values count as zero.
Sourcepub fn colors(self, colors: ScrollbarColors) -> Self
pub fn colors(self, colors: ScrollbarColors) -> Self
Sets the colors of the track and the thumb.
Sourcepub fn hide_when_content_fits(self, hide: bool) -> Self
pub fn hide_when_content_fits(self, hide: bool) -> Self
Sets whether the bar disappears when the content fits.
Sourcepub fn resolved_corner_radius(&self, thickness: f32) -> f32
pub fn resolved_corner_radius(&self, thickness: f32) -> f32
The corner radius to paint with on a bar of this thickness: a full pill unless the caller asked for something squarer.
Sourcepub fn thumb_bounds(&self, track: f32) -> ThumbBounds
pub fn thumb_bounds(&self, track: f32) -> ThumbBounds
How short the thumb may get on a track of track, as a fraction.
Trait Implementations§
Source§impl Clone for ScrollbarSpec
impl Clone for ScrollbarSpec
impl Copy for ScrollbarSpec
Source§impl Debug for ScrollbarSpec
impl Debug for ScrollbarSpec
Source§impl Default for ScrollbarSpec
impl Default for ScrollbarSpec
Source§impl PartialEq for ScrollbarSpec
impl PartialEq for ScrollbarSpec
impl StructuralPartialEq for ScrollbarSpec
Auto Trait Implementations§
impl Freeze for ScrollbarSpec
impl RefUnwindSafe for ScrollbarSpec
impl Send for ScrollbarSpec
impl Sync for ScrollbarSpec
impl Unpin for ScrollbarSpec
impl UnsafeUnpin for ScrollbarSpec
impl UnwindSafe for ScrollbarSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more