Skip to main content

ComputedScrollbarStyle

Struct ComputedScrollbarStyle 

Source
pub struct ComputedScrollbarStyle {
Show 19 fields pub width_mode: LayoutScrollbarWidth, pub visual_width_px: f32, pub reserve_width_px: f32, pub thumb_color: ColorU, pub track_color: ColorU, pub button_color: ColorU, pub corner_color: ColorU, pub clip_to_container_border: bool, pub fade_delay_ms: u32, pub fade_duration_ms: u32, pub visibility: ScrollbarVisibilityMode, pub show_scroll_buttons: bool, pub scroll_button_size_px: f32, pub show_corner_rect: bool, pub thumb_color_hover: Option<ColorU>, pub thumb_color_active: Option<ColorU>, pub track_color_hover: Option<ColorU>, pub visual_width_px_hover: Option<f32>, pub visual_width_px_active: Option<f32>,
}
Expand description

Computed scrollbar style for a node.

All visual defaults (colors, width) come from the UA CSS conditional rules in core/src/ua_css.rs — individual CssPropertyWithConditions entries for scrollbar-color and scrollbar-width, keyed on @os / @theme.

Overlay behaviour (fade timing, visibility, clip) is derived from the resolved scrollbar-width mode:

  • thin → overlay: fade 500/200 ms, WhenScrolling, clip = true
  • auto → classic: no fade, Always, clip = false
  • none → hidden: no fade, Always, clip = false

Per-node CSS overrides (in priority order):

  1. -azul-scrollbar-style (full ScrollbarInfo override)
  2. scrollbar-width (overrides width + overlay mode)
  3. scrollbar-color (overrides thumb / track colours)

Fields§

§width_mode: LayoutScrollbarWidth

The scrollbar width mode (auto/thin/none)

§visual_width_px: f32

Visual width in pixels — used for rendering track + thumb. Non-zero even for overlay scrollbars.

§reserve_width_px: f32

Reserve width in pixels — layout space subtracted from content area. 0 for overlay scrollbars, equal to visual_width_px for legacy.

§thumb_color: ColorU

Thumb color

§track_color: ColorU

Track color

§button_color: ColorU

Button color (for scroll arrows)

§corner_color: ColorU

Corner color (where scrollbars meet)

§clip_to_container_border: bool

Whether to clip the scrollbar to the container’s border-radius

§fade_delay_ms: u32

Delay in ms before scrollbar starts fading out (0 = never fade)

§fade_duration_ms: u32

Duration of fade-out animation in ms (0 = instant)

§visibility: ScrollbarVisibilityMode

Scrollbar visibility mode (always / when-scrolling / auto)

§show_scroll_buttons: bool

Whether to show top/bottom (or left/right) arrow buttons. When false, the track spans the entire scrollbar length.

§scroll_button_size_px: f32

Size of each arrow button in px (square: width = height). Only used when show_scroll_buttons == true.

§show_corner_rect: bool

Whether to show the corner rect where V and H scrollbars meet.

§thumb_color_hover: Option<ColorU>

Thumb color when hovered (None = use thumb_color)

§thumb_color_active: Option<ColorU>

Thumb color when pressed/active (None = use thumb_color)

§track_color_hover: Option<ColorU>

Track color when hovered (None = use track_color)

§visual_width_px_hover: Option<f32>

Visual width when hovered (None = use visual_width_px)

§visual_width_px_active: Option<f32>

Visual width when pressed (None = use visual_width_px)

Trait Implementations§

Source§

impl Clone for ComputedScrollbarStyle

Source§

fn clone(&self) -> ComputedScrollbarStyle

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 ComputedScrollbarStyle

Source§

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

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

impl Default for ComputedScrollbarStyle

Source§

fn default() -> Self

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

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