Skip to main content

ScrollbarPresentation

Struct ScrollbarPresentation 

Source
pub struct ScrollbarPresentation { /* private fields */ }
Expand description

Selectable visual and geometric policy for a Scrollbar.

The presentation stores separate glyph sets for both orientations so the same value can compose vertical and horizontal semantic scrollbars. A caller can clone a Theme-owned presentation and replace either set or any logical part style without changing the semantic value.

Implementations§

Source§

impl ScrollbarPresentation

Source

pub fn new(thumb_style: TextStyle, track_style: TextStyle) -> Self

Creates a proportional presentation with conventional thin rails.

Source

pub fn get_glyphs(&self, orientation: ScrollbarOrientation) -> &ScrollbarGlyphs

Source

pub fn glyphs( self, orientation: ScrollbarOrientation, glyphs: ScrollbarGlyphs, ) -> Self

Replaces the glyph set for one orientation.

Source

pub const fn get_thumb_sizing(&self) -> ScrollbarThumbSizing

Source

pub const fn thumb_sizing(self, thumb_sizing: ScrollbarThumbSizing) -> Self

Replaces the policy that maps viewport state onto the track.

Source

pub fn get_style(&self, role: ScrollbarRole) -> &TextStyle

Source

pub fn style(self, role: ScrollbarRole, style: TextStyle) -> Self

Replaces one complete logical part style.

Source

pub fn thumb_style(self, style: TextStyle) -> Self

Source

pub fn track_style(self, style: TextStyle) -> Self

Source

pub fn begin_style(self, style: TextStyle) -> Self

Source

pub fn end_style(self, style: TextStyle) -> Self

Source

pub fn compose(&self, scrollbar: &Scrollbar) -> View

Composes the semantic viewport state into a one-cell-cross-axis View.

The main axis remains area-dependent. Resolving a vertical scrollbar therefore requires a finite height, and resolving a horizontal one requires a finite width.

Trait Implementations§

Source§

impl Clone for ScrollbarPresentation

Source§

fn clone(&self) -> ScrollbarPresentation

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 ScrollbarPresentation

Source§

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

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

impl PartialEq for ScrollbarPresentation

Source§

fn eq(&self, other: &ScrollbarPresentation) -> 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 Eq for ScrollbarPresentation

Source§

impl StructuralPartialEq for ScrollbarPresentation

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