pub struct TextEditorState { /* private fields */ }Expand description
Core text editing state, shared between components
Implementations§
Source§impl TextEditorState
impl TextEditorState
pub fn new(size: Dp, line_height: Option<Dp>) -> Self
pub fn with_selection_color( size: Dp, line_height: Option<Dp>, selection_color: Color, ) -> Self
pub fn line_height(&self) -> Px
pub fn text_data(&mut self, constraint: TextConstraint) -> TextData
pub fn focus_handler(&self) -> &Focus
pub fn focus_handler_mut(&mut self) -> &mut Focus
pub fn editor(&self) -> &Editor<'static>
pub fn editor_mut(&mut self) -> &mut Editor<'static>
pub fn bink_timer(&self) -> Instant
pub fn update_bink_timer(&mut self)
pub fn selection_color(&self) -> Color
pub fn current_selection_rects(&self) -> &Vec<RectDef>
pub fn set_selection_color(&mut self, color: Color)
Sourcepub fn handle_click(
&mut self,
position: PxPosition,
timestamp: Instant,
) -> ClickType
pub fn handle_click( &mut self, position: PxPosition, timestamp: Instant, ) -> ClickType
Handle a click event and determine the click type (single, double, triple)
Sourcepub fn start_drag(&mut self)
pub fn start_drag(&mut self)
Start drag operation
Sourcepub fn is_dragging(&self) -> bool
pub fn is_dragging(&self) -> bool
Check if currently dragging
Sourcepub fn last_click_position(&self) -> Option<PxPosition>
pub fn last_click_position(&self) -> Option<PxPosition>
Get last click position
Sourcepub fn update_last_click_position(&mut self, position: PxPosition)
pub fn update_last_click_position(&mut self, position: PxPosition)
Update last click position (for drag tracking)
Auto Trait Implementations§
impl Freeze for TextEditorState
impl RefUnwindSafe for TextEditorState
impl Send for TextEditorState
impl Sync for TextEditorState
impl Unpin for TextEditorState
impl !UnwindSafe for TextEditorState
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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