pub struct ScrollArea {
pub pos_x: usize,
pub pos_y: usize,
pub width: usize,
pub height: usize,
pub content_height: usize,
pub scroll_speed: f32,
pub scrollbar_width: usize,
pub scrollbar_color: Color,
pub scrollbar_track_color: Color,
pub scrollbar_radius: usize,
/* private fields */
}Fields§
§pos_x: usize§pos_y: usize§width: usize§height: usize§content_height: usize§scroll_speed: f32§scrollbar_width: usize§scrollbar_color: Color§scrollbar_track_color: Color§scrollbar_radius: usizeImplementations§
Source§impl ScrollArea
impl ScrollArea
pub fn position(self, x: usize, y: usize) -> Self
pub fn size(self, width: usize, height: usize) -> Self
pub fn content_height(self, h: usize) -> Self
pub fn scroll_speed(self, speed: f32) -> Self
pub fn scrollbar_width(self, w: usize) -> Self
pub fn scrollbar_color(self, color: Color) -> Self
pub fn scrollbar_track_color(self, color: Color) -> Self
pub fn scrollbar_radius(self, r: usize) -> Self
Sourcepub fn set_content_height(&mut self, h: usize)
pub fn set_content_height(&mut self, h: usize)
Sets the content height dynamically (call before draw each frame if content changes)
Sourcepub fn set_offset(&mut self, offset: f32)
pub fn set_offset(&mut self, offset: f32)
Sets scroll offset directly
Sourcepub fn can_scroll(&self) -> bool
pub fn can_scroll(&self) -> bool
Returns true if content overflows the visible area
Sourcepub fn begin_draw(&mut self, window: &mut Window)
pub fn begin_draw(&mut self, window: &mut Window)
Updates scroll state (call once per frame, before drawing content)
Pushes a clip region. Call end_draw after drawing content.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScrollArea
impl RefUnwindSafe for ScrollArea
impl Send for ScrollArea
impl Sync for ScrollArea
impl Unpin for ScrollArea
impl UnsafeUnpin for ScrollArea
impl UnwindSafe for ScrollArea
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