pub struct ScrollbarStyle {
pub thickness: f64,
pub hover_thickness: f64,
pub min_thumb: f64,
pub inset: f64,
pub fade_delay_ms: f64,
pub fade_duration_ms: f64,
pub show: ScrollbarShow,
}Expand description
Metrics and visibility of an opt-in scrollbar, handed to
ScrollView::scrollbar or
ListView::scrollbar (vertical only; no
horizontal or CustomScrollView surface takes one). Colors come from the
theme (on_surface_variant), with an unthemed fallback.
use frust_widgets::{ScrollView, ScrollbarShow, ScrollbarStyle, scroll_view, text};
let style = ScrollbarStyle::default().show(ScrollbarShow::Always).thickness(4.0);
let view: ScrollView<()> = scroll_view(text("hi")).scrollbar(style);Fields§
§thickness: f64Resting bar thickness, logical px.
hover_thickness: f64Thickness while the lane is hovered or the thumb is held.
min_thumb: f64Shortest thumb painted, clamped to the track length.
inset: f64Gap between the bar and the viewport’s trailing, top and bottom edges.
fade_delay_ms: f64Idle hold before the fade starts, in ms.
fade_duration_ms: f64Fade-out length, in ms; reduce_motion or 0 snaps instead.
show: ScrollbarShowWhen the bar is visible.
Implementations§
Source§impl ScrollbarStyle
impl ScrollbarStyle
Sourcepub fn new(show: ScrollbarShow) -> Self
pub fn new(show: ScrollbarShow) -> Self
The default style with show as its visibility rule.
Sourcepub fn show(self, show: ScrollbarShow) -> Self
pub fn show(self, show: ScrollbarShow) -> Self
Set ScrollbarStyle::show.
Sourcepub fn hover_thickness(self, px: f64) -> Self
pub fn hover_thickness(self, px: f64) -> Self
Sourcepub fn fade_delay_ms(self, ms: f64) -> Self
pub fn fade_delay_ms(self, ms: f64) -> Self
Sourcepub fn fade_duration_ms(self, ms: f64) -> Self
pub fn fade_duration_ms(self, ms: f64) -> Self
Trait Implementations§
Source§impl Clone for ScrollbarStyle
impl Clone for ScrollbarStyle
impl Copy for ScrollbarStyle
Source§impl Debug for ScrollbarStyle
impl Debug for ScrollbarStyle
Source§impl Default for ScrollbarStyle
impl Default for ScrollbarStyle
Source§impl PartialEq for ScrollbarStyle
impl PartialEq for ScrollbarStyle
impl StructuralPartialEq for ScrollbarStyle
Auto Trait Implementations§
impl Freeze for ScrollbarStyle
impl RefUnwindSafe for ScrollbarStyle
impl Send for ScrollbarStyle
impl Sync for ScrollbarStyle
impl Unpin for ScrollbarStyle
impl UnsafeUnpin for ScrollbarStyle
impl UnwindSafe for ScrollbarStyle
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
impl<T> Brush for 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> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.