pub struct ParagraphState {
pub area: Rect,
pub inner: Rect,
pub lines: usize,
pub vscroll: ScrollState,
pub hscroll: ScrollState,
pub focus: FocusFlag,
pub non_exhaustive: NonExhaustive,
}Expand description
State & event handling.
Fields§
§area: RectFull area of the widget. readonly. renewed for each render.
inner: RectInner area of the widget. readonly. renewed for each render.
lines: usizeText lines
vscroll: ScrollStateVertical scroll. read+write
hscroll: ScrollStateHorizontal scroll. read+write
focus: FocusFlagFocus. read+write
non_exhaustive: NonExhaustiveImplementations§
Source§impl ParagraphState
impl ParagraphState
pub fn new() -> Self
pub fn named(name: &str) -> Self
Sourcepub fn line_offset(&self) -> usize
pub fn line_offset(&self) -> usize
Current offset.
Sourcepub fn set_line_offset(&mut self, offset: usize) -> bool
pub fn set_line_offset(&mut self, offset: usize) -> bool
Set limited offset.
Sourcepub fn col_offset(&self) -> usize
pub fn col_offset(&self) -> usize
Current offset.
Sourcepub fn set_col_offset(&mut self, offset: usize) -> bool
pub fn set_col_offset(&mut self, offset: usize) -> bool
Set limited offset.
Sourcepub fn scroll_left(&mut self, n: usize) -> bool
pub fn scroll_left(&mut self, n: usize) -> bool
Scroll left by n.
Sourcepub fn scroll_right(&mut self, n: usize) -> bool
pub fn scroll_right(&mut self, n: usize) -> bool
Scroll right by n.
Sourcepub fn scroll_down(&mut self, n: usize) -> bool
pub fn scroll_down(&mut self, n: usize) -> bool
Scroll down by n.
Trait Implementations§
Source§impl Clone for ParagraphState
impl Clone for ParagraphState
Source§impl Debug for ParagraphState
impl Debug for ParagraphState
Source§impl Default for ParagraphState
impl Default for ParagraphState
Source§impl HandleEvent<Event, MouseOnly, Outcome> for ParagraphState
impl HandleEvent<Event, MouseOnly, Outcome> for ParagraphState
Source§impl HandleEvent<Event, Regular, Outcome> for ParagraphState
impl HandleEvent<Event, Regular, Outcome> for ParagraphState
Source§impl HasFocus for ParagraphState
impl HasFocus for ParagraphState
Source§fn build(&self, builder: &mut FocusBuilder)
fn build(&self, builder: &mut FocusBuilder)
Build the focus-structure for the container.
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.
Auto Trait Implementations§
impl !Freeze for ParagraphState
impl !RefUnwindSafe for ParagraphState
impl !Send for ParagraphState
impl !Sync for ParagraphState
impl Unpin for ParagraphState
impl !UnwindSafe for ParagraphState
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