pub struct ViewState {
pub area: Rect,
pub widget_area: Rect,
pub layout: Rect,
pub hscroll: ScrollState,
pub vscroll: ScrollState,
pub focus: FocusFlag,
/* private fields */
}Expand description
View state.
Fields§
§area: RectFull area for the widget. read only renewed for each render.
widget_area: RectArea inside the border. read only renewed for each render.
layout: RectThe layout of the temp buffer uses. read only renewed for each render.
hscroll: ScrollStateHorizontal scroll read+write
vscroll: ScrollStateVertical scroll read+write
focus: FocusFlagCurrent focus state. read+write
Implementations§
Source§impl ViewState
impl ViewState
pub fn vertical_offset(&self) -> usize
pub fn set_vertical_offset(&mut self, offset: usize) -> bool
pub fn vertical_page_len(&self) -> usize
pub fn horizontal_offset(&self) -> usize
pub fn set_horizontal_offset(&mut self, offset: usize) -> bool
pub fn horizontal_page_len(&self) -> usize
pub fn horizontal_scroll_to(&mut self, pos: usize) -> bool
pub fn vertical_scroll_to(&mut self, pos: usize) -> bool
pub fn scroll_up(&mut self, delta: usize) -> bool
pub fn scroll_down(&mut self, delta: usize) -> bool
pub fn scroll_left(&mut self, delta: usize) -> bool
pub fn scroll_right(&mut self, delta: usize) -> bool
Trait Implementations§
Source§impl HasFocus for ViewState
impl HasFocus for ViewState
Source§fn build(&self, builder: &mut FocusBuilder)
fn build(&self, builder: &mut FocusBuilder)
Build the focus-structure for the container/widget.
Build the focus-structure for the container/widget.
This is called when the default navigation will be
overridden by the builder. Read more
Declares how the widget interacts with focus. Read more
Source§fn is_focused(&self) -> bool
fn is_focused(&self) -> bool
Focused?
Source§fn lost_focus(&self) -> bool
fn lost_focus(&self) -> bool
Just lost focus.
Source§fn gained_focus(&self) -> bool
fn gained_focus(&self) -> bool
Just gained focus.
Source§impl RelocatableState for ViewState
impl RelocatableState for ViewState
Source§fn relocate(&mut self, shift: (i16, i16), clip: Rect)
fn relocate(&mut self, shift: (i16, i16), clip: Rect)
Relocate the areas in this widgets state. Read more
Source§fn relocate_popup(&mut self, shift: (i16, i16), clip: Rect)
fn relocate_popup(&mut self, shift: (i16, i16), clip: Rect)
Relocate only popup areas.
As rendering the popups is a separate render,
this has to be separate too.
Relocate all popup areas to a clip-rect (0,0+0x0).
Relocate all areas to a clip-rect (0,0+0x0).
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> 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