Struct rat_widget::scrolled::ViewState
source · pub struct ViewState {
pub area: Rect,
pub view_area: Rect,
pub h_offset: usize,
pub v_offset: usize,
pub non_exhaustive: NonExhaustive,
}Expand description
State of the view.
Fields§
§area: RectThe drawing area for the view.
view_area: RectThe view area that the inner widget sees.
h_offset: usizeHorizontal offset
v_offset: usizeVertical offset
non_exhaustive: NonExhaustiveOnly construct with ..Default::default().
Trait Implementations§
source§impl<R> HandleEvent<Event, FocusKeys, ScrollOutcome<R>> for ViewStatewhere
R: ConsumedEvent,
impl<R> HandleEvent<Event, FocusKeys, ScrollOutcome<R>> for ViewStatewhere
R: ConsumedEvent,
Handle all events. Text events are only processed if focus is true. Mouse events are processed if they are in range.
source§impl<R> HandleEvent<Event, MouseOnly, ScrollOutcome<R>> for ViewStatewhere
R: ConsumedEvent,
impl<R> HandleEvent<Event, MouseOnly, ScrollOutcome<R>> for ViewStatewhere
R: ConsumedEvent,
Handle only mouse-events.
source§impl ScrollingState for ViewState
impl ScrollingState for ViewState
source§fn vertical_max_offset(&self) -> usize
fn vertical_max_offset(&self) -> usize
Maximum offset that is accessible with scrolling. Read more
source§fn vertical_offset(&self) -> usize
fn vertical_offset(&self) -> usize
Current vertical offset.
source§fn vertical_page(&self) -> usize
fn vertical_page(&self) -> usize
Vertical page-size at the current offset.
source§fn horizontal_max_offset(&self) -> usize
fn horizontal_max_offset(&self) -> usize
Maximum offset that is accessible with scrolling. Read more
source§fn horizontal_offset(&self) -> usize
fn horizontal_offset(&self) -> usize
Current horizontal offset.
source§fn horizontal_page(&self) -> usize
fn horizontal_page(&self) -> usize
Horizontal page-size at the current offset.
source§fn set_vertical_offset(&mut self, offset: usize) -> bool
fn set_vertical_offset(&mut self, offset: usize) -> bool
Change the vertical offset. Read more
source§fn set_horizontal_offset(&mut self, offset: usize) -> bool
fn set_horizontal_offset(&mut self, offset: usize) -> bool
Change the horizontal offset. Read more
source§fn vertical_scroll(&self) -> usize
fn vertical_scroll(&self) -> usize
Suggested scroll per scroll-event.
source§fn horizontal_scroll(&self) -> usize
fn horizontal_scroll(&self) -> usize
Suggested scroll per scroll-event.
source§fn scroll_up(&mut self, n: usize) -> bool
fn scroll_up(&mut self, n: usize) -> bool
Scroll up by n items.
The widget returns true if the offset changed at all.
source§fn scroll_down(&mut self, n: usize) -> bool
fn scroll_down(&mut self, n: usize) -> bool
Scroll down by n items.
The widget returns true if the offset changed at all.
source§fn scroll_left(&mut self, n: usize) -> bool
fn scroll_left(&mut self, n: usize) -> bool
Scroll up by n items.
The widget returns true if the offset changed at all.
source§fn scroll_right(&mut self, n: usize) -> bool
fn scroll_right(&mut self, n: usize) -> bool
Scroll down by n items.
The widget returns true if the offset changed at all.
Auto Trait Implementations§
impl Freeze for ViewState
impl RefUnwindSafe for ViewState
impl Send for ViewState
impl Sync for ViewState
impl Unpin for ViewState
impl UnwindSafe for ViewState
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> 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