pub struct ScrollManager { /* private fields */ }Expand description
Manages scroll regions for all scrollable widgets.
Implementations§
Source§impl ScrollManager
impl ScrollManager
Sourcepub fn register(
&mut self,
widget_id: WidgetId,
content_width: u16,
content_height: u16,
viewport_width: u16,
viewport_height: u16,
)
pub fn register( &mut self, widget_id: WidgetId, content_width: u16, content_height: u16, viewport_width: u16, viewport_height: u16, )
Register a scrollable region for a widget.
Sourcepub fn scroll_by(&mut self, widget_id: WidgetId, dx: i16, dy: i16)
pub fn scroll_by(&mut self, widget_id: WidgetId, dx: i16, dy: i16)
Scroll by a relative offset, clamping to valid range.
Sourcepub fn scroll_to(&mut self, widget_id: WidgetId, x: u16, y: u16)
pub fn scroll_to(&mut self, widget_id: WidgetId, x: u16, y: u16)
Scroll to an absolute position, clamping to valid range.
Sourcepub fn get(&self, widget_id: WidgetId) -> Option<&ScrollState>
pub fn get(&self, widget_id: WidgetId) -> Option<&ScrollState>
Get the scroll state for a widget.
Sourcepub fn can_scroll_x(&self, widget_id: WidgetId) -> bool
pub fn can_scroll_x(&self, widget_id: WidgetId) -> bool
Check if a widget can scroll horizontally.
Sourcepub fn can_scroll_y(&self, widget_id: WidgetId) -> bool
pub fn can_scroll_y(&self, widget_id: WidgetId) -> bool
Check if a widget can scroll vertically.
Sourcepub fn visible_rect(&self, widget_id: WidgetId) -> Option<Rect>
pub fn visible_rect(&self, widget_id: WidgetId) -> Option<Rect>
Get the visible content rectangle for a scrollable widget.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScrollManager
impl RefUnwindSafe for ScrollManager
impl Send for ScrollManager
impl Sync for ScrollManager
impl Unpin for ScrollManager
impl UnwindSafe for ScrollManager
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