pub struct ScrollbarState {
pub visible: bool,
pub orientation: ScrollbarOrientation,
pub base_size: f32,
pub scale: LogicalPosition,
pub thumb_position_ratio: f32,
pub thumb_size_ratio: f32,
pub track_rect: LogicalRect,
}Expand description
Scrollbar geometry state (calculated per frame, used for hit-testing and rendering)
Fields§
§visible: boolIs this scrollbar visible? (content larger than container)
orientation: ScrollbarOrientationOrientation
base_size: f32Base size (1:1 square, width = height). This is the unscaled size.
scale: LogicalPositionScale transform to apply (calculated from container size)
thumb_position_ratio: f32Thumb position ratio (0.0 = top/left, 1.0 = bottom/right)
thumb_size_ratio: f32Thumb size ratio (0.0 = invisible, 1.0 = entire track)
track_rect: LogicalRectPosition of the scrollbar in the container (for hit-testing)
Implementations§
Source§impl ScrollbarState
impl ScrollbarState
Sourcepub fn hit_test_component(
&self,
local_pos: LogicalPosition,
) -> ScrollbarComponent
pub fn hit_test_component( &self, local_pos: LogicalPosition, ) -> ScrollbarComponent
Determine which component was hit at the given local position (relative to track_rect origin)
Trait Implementations§
Source§impl Clone for ScrollbarState
impl Clone for ScrollbarState
Source§fn clone(&self) -> ScrollbarState
fn clone(&self) -> ScrollbarState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ScrollbarState
impl RefUnwindSafe for ScrollbarState
impl Send for ScrollbarState
impl Sync for ScrollbarState
impl Unpin for ScrollbarState
impl UnwindSafe for ScrollbarState
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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