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 mixin.
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>
Source§impl<P: WidgetImpl> TextInspectMix<P>
impl<P: WidgetImpl> TextInspectMix<P>
Sourcepub fn has_selection(&self, state: impl IntoVar<bool>)
pub fn has_selection(&self, state: impl IntoVar<bool>)
P If widget or rich context has selection.
If set on a text widget gets if the local text has a selection, otherwise gets if the rich text context has a selection.
Source§impl<P: WidgetImpl> TextInspectMix<P>
impl<P: WidgetImpl> TextInspectMix<P>
Sourcepub fn get_selection(&self, state: impl IntoVar<Txt>)
pub fn get_selection(&self, state: impl IntoVar<Txt>)
P Gets the selected text in the widget.
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
§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>
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>
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