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,
pub button_size: f32,
pub usable_track_length: f32,
pub thumb_length: f32,
pub thumb_offset: f32,
}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)
Button size (square: button_size × button_size)
usable_track_length: f32Usable track length after subtracting buttons
thumb_length: f32Thumb length in pixels
thumb_offset: f32Thumb offset from start of usable track region
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). Uses the shared geometry values (button_size, usable_track_length, thumb_length, thumb_offset) for consistent hit-testing.
Trait Implementations§
Source§impl Clone for ScrollbarState
impl Clone for ScrollbarState
Source§fn clone(&self) -> ScrollbarState
fn clone(&self) -> ScrollbarState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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 UnsafeUnpin 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
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>
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>
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