pub struct EditOptions {
pub style: TextStyle,
pub multiline: bool,
pub wrap: bool,
pub autofocus: bool,
pub accent: Option<Color>,
}Expand description
How a text_edit node behaves: its text style, whether it is a
single-line field or a multiline document, and how it takes focus and
paints its selection. Build one with struct update syntax from
Default.
Fields§
§style: TextStyle§multiline: boolA document rather than a field: Enter inserts a newline, the text wraps to the box, and the caret opens at the top.
wrap: boolA single-line editor that folds to its width, by style.wrap, the
way a document does — instead of taking one line and scrolling it
under the caret. Its keyboard is still a field’s:
Enter submits, a newline is never admitted, the caret opens at the
end. In the bindings this is the wrap row being declared on the
element; off, a field does not read style.wrap at all. A
multiline editor wraps either way and ignores this.
autofocus: boolTakes keyboard focus on the frame this declaration starts — a new editor, one back after a gap, one whose flag just turned on — and only while nothing holds focus: never from a focused control, and never again after a blur.
accent: Option<Color>Selection highlight color. None is the theme’s selection,
which is what a field gets unless the caller says otherwise — so a
selection over a label and one over a field are the same tint on
both bases.