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) -> ScrollbarStyle
pub fn new(show: ScrollbarShow) -> ScrollbarStyle
The default style with show as its visibility rule.
Sourcepub fn show(self, show: ScrollbarShow) -> ScrollbarStyle
pub fn show(self, show: ScrollbarShow) -> ScrollbarStyle
Set ScrollbarStyle::show.
Sourcepub fn thickness(self, px: f64) -> ScrollbarStyle
pub fn thickness(self, px: f64) -> ScrollbarStyle
Sourcepub fn hover_thickness(self, px: f64) -> ScrollbarStyle
pub fn hover_thickness(self, px: f64) -> ScrollbarStyle
Sourcepub fn min_thumb(self, px: f64) -> ScrollbarStyle
pub fn min_thumb(self, px: f64) -> ScrollbarStyle
Sourcepub fn inset(self, px: f64) -> ScrollbarStyle
pub fn inset(self, px: f64) -> ScrollbarStyle
Sourcepub fn fade_delay_ms(self, ms: f64) -> ScrollbarStyle
pub fn fade_delay_ms(self, ms: f64) -> ScrollbarStyle
Sourcepub fn fade_duration_ms(self, ms: f64) -> ScrollbarStyle
pub fn fade_duration_ms(self, ms: f64) -> ScrollbarStyle
Trait Implementations§
Source§impl Clone for ScrollbarStyle
impl Clone for ScrollbarStyle
Source§fn clone(&self) -> ScrollbarStyle
fn clone(&self) -> ScrollbarStyle
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 ScrollbarStyle
Source§impl Debug for ScrollbarStyle
impl Debug for ScrollbarStyle
Source§impl Default for ScrollbarStyle
impl Default for ScrollbarStyle
Source§fn default() -> ScrollbarStyle
fn default() -> ScrollbarStyle
Returns the “default value” for a type. Read more
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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.