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: ScrollbarColors§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
pub fn thickness(self, thickness: f32) -> Self
pub fn min_thumb_extent(self, extent: f32) -> Self
pub fn corner_radius(self, radius: f32) -> Self
pub fn colors(self, colors: ScrollbarColors) -> Self
pub fn hide_when_content_fits(self, hide: bool) -> Self
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
Source§fn clone(&self) -> ScrollbarSpec
fn clone(&self) -> ScrollbarSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl 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
Mutably borrows from an owned value. Read more