Skip to main content

ScrollBarStyle

Struct ScrollBarStyle 

Source
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: f64

Width of the full-size bar in pixels. This is the bar width when the user is hovering or interacting with it.

§floating_width: f64

Thin 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: f64

Minimum length of the draggable thumb.

§outer_margin: f64

Space between the bar and the panel’s outer edge.

§inner_margin: f64

Space between the bar and the content area.

§content_margin: f64

Space between sibling content and the bar area (applied when kind = Solid and as a decorative inset when Floating).

§margin_same: bool

true = 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: ScrollBarKind

Bar kind — Solid reserves space in layout, Floating overlays content.

§color: ScrollBarColor

Which colour role the bar uses.

§fade_strength: f64

Alpha of the fade-out region along the scroll-axis edges, 0..1.

§fade_size: f64

Length of the fade region in pixels at each end.

Implementations§

Source§

impl ScrollBarStyle

Source

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

Source

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.

Source

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).

Source

pub fn floating() -> Self

Preset matching egui’s ScrollStyle::floating — wide floating overlay with fade gradient at the edges.

Trait Implementations§

Source§

impl Clone for ScrollBarStyle

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Debug for ScrollBarStyle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ScrollBarStyle

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ScrollBarStyle

Source§

fn eq(&self, other: &ScrollBarStyle) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for ScrollBarStyle

Source§

impl StructuralPartialEq for ScrollBarStyle

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts 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>

Converts 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)

Converts &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)

Converts &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
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<A> Is for A
where A: Any,

Source§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> TypeData for T
where T: 'static + Send + Sync + Clone,

Source§

fn clone_type_data(&self) -> Box<dyn TypeData>

Creates a type-erased clone of this value.