Struct rat_widget::paragraph::ParagraphState
source · pub struct ParagraphState {
pub area: Rect,
pub inner: Rect,
pub focus: FocusFlag,
pub vscroll: ScrollState,
pub hscroll: ScrollState,
pub non_exhaustive: NonExhaustive,
}Expand description
State & event handling.
Fields§
§area: RectFull area of the widget.
inner: RectInner area of the widget.
focus: FocusFlagFocus
vscroll: ScrollStateVertical scroll
hscroll: ScrollStateHorizontal scroll
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§fn clone(&self) -> ParagraphState
fn clone(&self) -> ParagraphState
Returns a copy 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 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 HasFocusFlag for ParagraphState
impl HasFocusFlag for ParagraphState
source§fn z_areas(&self) -> &[ZRect]
fn z_areas(&self) -> &[ZRect]
The widget might have several disjointed areas.
This is the case if it is showing a popup, but there
might be other causes. 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.
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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