pub struct ScrollableContentState { /* private fields */ }Expand description
State for the ScrollableContent component
Implementations§
Source§impl ScrollableContentState
impl ScrollableContentState
Sourcepub fn line_count(&self) -> usize
pub fn line_count(&self) -> usize
Get the number of lines
Sourcepub fn scroll_offset(&self) -> usize
pub fn scroll_offset(&self) -> usize
Get the current scroll offset
Sourcepub fn set_scroll_offset(&mut self, offset: usize)
pub fn set_scroll_offset(&mut self, offset: usize)
Set the scroll offset
Sourcepub fn is_focused(&self) -> bool
pub fn is_focused(&self) -> bool
Check if focused
Sourcepub fn set_focused(&mut self, focused: bool)
pub fn set_focused(&mut self, focused: bool)
Set focus state
Sourcepub fn is_fullscreen(&self) -> bool
pub fn is_fullscreen(&self) -> bool
Check if in fullscreen mode
Sourcepub fn set_fullscreen(&mut self, fullscreen: bool)
pub fn set_fullscreen(&mut self, fullscreen: bool)
Set fullscreen mode
Sourcepub fn toggle_fullscreen(&mut self) -> bool
pub fn toggle_fullscreen(&mut self) -> bool
Toggle fullscreen mode
Sourcepub fn scroll_down(&mut self, lines: usize, visible_height: usize)
pub fn scroll_down(&mut self, lines: usize, visible_height: usize)
Scroll down by the given number of lines
Sourcepub fn scroll_to_top(&mut self)
pub fn scroll_to_top(&mut self)
Scroll to the top
Sourcepub fn scroll_to_bottom(&mut self, visible_height: usize)
pub fn scroll_to_bottom(&mut self, visible_height: usize)
Scroll to the bottom
Sourcepub fn visible_lines(&self, height: usize) -> &[String]
pub fn visible_lines(&self, height: usize) -> &[String]
Get a slice of visible lines based on current scroll position and height
Sourcepub fn is_at_bottom(&self, visible_height: usize) -> bool
pub fn is_at_bottom(&self, visible_height: usize) -> bool
Check if scrolled to bottom (given visible height)
Sourcepub fn content_as_string(&self) -> String
pub fn content_as_string(&self) -> String
Get the content as a single string (for clipboard copy)
Trait Implementations§
Source§impl Clone for ScrollableContentState
impl Clone for ScrollableContentState
Source§fn clone(&self) -> ScrollableContentState
fn clone(&self) -> ScrollableContentState
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 moreSource§impl Debug for ScrollableContentState
impl Debug for ScrollableContentState
Auto Trait Implementations§
impl Freeze for ScrollableContentState
impl RefUnwindSafe for ScrollableContentState
impl Send for ScrollableContentState
impl Sync for ScrollableContentState
impl Unpin for ScrollableContentState
impl UnwindSafe for ScrollableContentState
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