Skip to main content

TextArea

Struct TextArea 

Source
pub struct TextArea { /* private fields */ }
Expand description

A block of editable text.

Build one with text_area. The area keeps the editor and the glyph runs of the paragraphs it shows, and rebuilds the runs only when the editor laid a paragraph out again, the area moved or scrolled, or the resolved text color changed.

Trait Implementations§

Source§

impl Widget for TextArea

Source§

fn semantics(&self) -> Option<Semantics>

Reports the area’s placeholder as the accessible name and its text as the accessible value.

An area with no placeholder reports no name, which leaves the announcement to the area’s surroundings.

Source§

fn paint(&self, cx: &PaintCx<'_>, out: &mut Vec<PaintOp>)

Appends the selection, the underline under a composing preedit, the text or the placeholder, in that order, for the paragraphs the content box shows.

Painting also records the content box, which the pointer handlers and the next edit read, and places the caret against it. An edit has placed the caret already, so this only moves it when the box itself changed, which lands one frame later like every size-driven change.

§Panics

Panics under the conditions of TextSystem::with, or when the glyph run cache is already borrowed on this thread, which the paint pass cannot do.

Source§

fn ime_area(&self) -> Option<Rect>

Reports the area the input method anchors to while the area holds the focus.

The area is the text the user is editing, which is the preedit while one is being composed and the selection otherwise, in paint coordinates.

Source§

fn measure(&mut self, _input: MeasureInput) -> Option<Size>

Returns the size of this widget’s content, or None to let the layout engine size the node from its style. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.