pub struct TextInspectMix<P>(/* private fields */);
Expand description
m
Properties that probes various state from the text widget.
Implementations§
source§impl TextInspectMix<()>
impl TextInspectMix<()>
sourcepub fn context_vars_set(set: &mut ContextValueSet)
pub fn context_vars_set(set: &mut ContextValueSet)
Insert context variables used by properties in this mix-in.
source§impl<P: WidgetImpl> TextInspectMix<P>
impl<P: WidgetImpl> TextInspectMix<P>
sourcepub fn get_caret_index(&self, index: impl IntoVar<Option<CaretIndex>>)
pub fn get_caret_index(&self, index: impl IntoVar<Option<CaretIndex>>)
P
Gets the caret char index, if the text is editable.
source§impl<P: WidgetImpl> TextInspectMix<P>
impl<P: WidgetImpl> TextInspectMix<P>
sourcepub fn get_caret_status(&self, status: impl IntoVar<CaretStatus>)
pub fn get_caret_status(&self, status: impl IntoVar<CaretStatus>)
P
Gets the caret display status, if the text is editable.
source§impl<P: WidgetImpl> TextInspectMix<P>
impl<P: WidgetImpl> TextInspectMix<P>
sourcepub fn get_lines_len(&self, len: impl IntoVar<usize>)
pub fn get_lines_len(&self, len: impl IntoVar<usize>)
P
Gets the number of lines in the text, including wrap lines.
This is very cheap, the text widget already has the length, but it does include wrapped lines. You
can use get_lines_wrap_count
to get text lines and a count of wrapped lines for each.
source§impl<P: WidgetImpl> TextInspectMix<P>
impl<P: WidgetImpl> TextInspectMix<P>
sourcepub fn get_lines_wrap_count(&self, lines: impl IntoVar<LinesWrapCount>)
pub fn get_lines_wrap_count(&self, lines: impl IntoVar<LinesWrapCount>)
P
Gets the number of wrap lines per text lines.
source§impl<P: WidgetImpl> TextInspectMix<P>
impl<P: WidgetImpl> TextInspectMix<P>
sourcepub fn get_chars_count(&self, chars: impl IntoVar<usize>)
pub fn get_chars_count(&self, chars: impl IntoVar<usize>)
P
Gets the number of character in the text.
source§impl<P: WidgetImpl> TextInspectMix<P>
impl<P: WidgetImpl> TextInspectMix<P>
sourcepub fn txt_highlight(
&self,
range: impl IntoVar<Range<CaretIndex>>,
color: impl IntoVar<Rgba>,
)
pub fn txt_highlight( &self, range: impl IntoVar<Range<CaretIndex>>, color: impl IntoVar<Rgba>, )
P
Highlight a text range.
This property must be set in the text widget.
source§impl<P: WidgetImpl> TextInspectMix<P>
impl<P: WidgetImpl> TextInspectMix<P>
Trait Implementations§
source§impl<P> Deref for TextInspectMix<P>
impl<P> Deref for TextInspectMix<P>
Auto Trait Implementations§
impl<P> Freeze for TextInspectMix<P>where
P: Freeze,
impl<P> RefUnwindSafe for TextInspectMix<P>where
P: RefUnwindSafe,
impl<P> Send for TextInspectMix<P>where
P: Send,
impl<P> Sync for TextInspectMix<P>where
P: Sync,
impl<P> Unpin for TextInspectMix<P>where
P: Unpin,
impl<P> UnwindSafe for TextInspectMix<P>where
P: UnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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