pub struct EditOptions {
pub style: TextStyle,
pub multiline: bool,
pub wrap: bool,
pub autofocus: bool,
pub keep_tab: bool,
pub placeholder: Option<String>,
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.
keep_tab: boolA single-line editor whose Tab is the app’s: Tab and Shift-Tab do
not walk the focus ring from it, and the press goes to the key
sink above it as a chord the editor does not claim does — so a
list or an outline built from fields indents on Tab (backlog F146).
With no sink above, Tab does nothing here. A multiline editor
keeps Tab for indentation either way and ignores this.
placeholder: Option<String>What an empty editor shows where its text would be, in the theme’s
faint (backlog F149): never part of the value, gone with the
first character typed or composed, and read by assistive
technology as the field’s description when it declares none.
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.