pub struct ScrollBarStyle {
pub bar_width: f64,
pub floating_width: f64,
pub handle_min_length: f64,
pub outer_margin: f64,
pub inner_margin: f64,
pub content_margin: f64,
pub margin_same: bool,
pub kind: ScrollBarKind,
pub color: ScrollBarColor,
pub fade_strength: f64,
pub fade_size: f64,
}Expand description
Full scrollbar appearance configuration — mirrors egui’s style.spacing.scroll.
Fields§
§bar_width: f64Width of the full-size bar in pixels. This is the bar width when the user is hovering or interacting with it.
floating_width: f64Thin width shown when the bar is dormant (not hovered, not dragging).
Matches egui’s floating_width. On hover the bar grows from this to
Self::bar_width. Set equal to bar_width to disable the expand
effect. Only takes effect when smaller than bar_width.
handle_min_length: f64Minimum length of the draggable thumb.
outer_margin: f64Space between the bar and the panel’s outer edge.
inner_margin: f64Space between the bar and the content area.
content_margin: f64Space between sibling content and the bar area (applied when kind = Solid
and as a decorative inset when Floating).
margin_same: booltrue = use one value for both axes; false = each axis may differ
(we keep a single value here for brevity and apply it to both).
kind: ScrollBarKindBar kind — Solid reserves space in layout, Floating overlays content.
color: ScrollBarColorWhich colour role the bar uses.
fade_strength: f64Alpha of the fade-out region along the scroll-axis edges, 0..1.
fade_size: f64Length of the fade region in pixels at each end.
Implementations§
Source§impl ScrollBarStyle
impl ScrollBarStyle
Sourcepub fn bar_width_at(&self, t: f64) -> f64
pub fn bar_width_at(&self, t: f64) -> f64
Interpolated bar width for a hover-animation parameter t in [0, 1].
t = 0 returns Self::floating_width (dormant); t = 1 returns
Self::bar_width (fully expanded). Clamps floating_width so it
never exceeds bar_width, regardless of what the caller set.
ScrollBarKind::Solid bars do not animate width — they always
render at bar_width so the “Full bar width” setting takes immediate
visible effect. Only ScrollBarKind::Floating bars expand on hover.
Source§impl ScrollBarStyle
impl ScrollBarStyle
Sourcepub fn solid() -> Self
pub fn solid() -> Self
Preset matching egui’s ScrollStyle::solid — always-visible bar, solid
layout, fills reserved space. Solid bars don’t expand on hover so
floating_width equals bar_width.
Sourcepub fn thin() -> Self
pub fn thin() -> Self
Preset matching egui’s ScrollStyle::thin — a narrow floating bar
that’s always visible at its thin width and expands to full width when
hovered. Callers should pair this with
ScrollBarVisibility::AlwaysVisible so the dormant thin bar is
rendered even when the cursor isn’t over it (the appearance panel’s
preset button does this).
Trait Implementations§
Source§impl Clone for ScrollBarStyle
impl Clone for ScrollBarStyle
Source§fn clone(&self) -> ScrollBarStyle
fn clone(&self) -> ScrollBarStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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
Source§fn eq(&self, other: &ScrollBarStyle) -> bool
fn eq(&self, other: &ScrollBarStyle) -> bool
self and other values to be equal, and is used by ==.impl Copy 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
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>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn 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>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which 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)
&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)
&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> DowncastSend for T
impl<T> DowncastSend for T
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().