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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more