plushie/widget/text_editor

Text editor widget builder (multi-line text editing).

Types

Option type for text editor properties.

pub type Opt {
  Placeholder(String)
  Width(length.Length)
  Height(length.Length)
  MinHeight(Float)
  MaxHeight(Float)
  Padding(Float)
  Font(font.Font)
  Size(Float)
  LineHeight(line_height.LineHeight)
  Wrapping(wrapping.Wrapping)
  TextDirection(text_direction.TextDirection)
  InputPurpose(input_purpose.InputPurpose)
  HighlightSyntax(String)
  HighlightTheme(String)
  Style(String)
  KeyBindings(List(node.PropValue))
  PlaceholderColor(color.Color)
  SelectionColor(color.Color)
  Required(Bool)
  Validation(validation_state.ValidationState)
  A11y(a11y.A11y)
}

Constructors

pub opaque type TextEditor

Values

pub fn a11y(te: TextEditor, a: a11y.A11y) -> TextEditor

Set accessibility properties for this widget.

pub fn build(te: TextEditor) -> node.Node

Build the text editor into a renderable Node.

pub fn font(te: TextEditor, f: font.Font) -> TextEditor

Set the font.

pub fn height(te: TextEditor, h: length.Length) -> TextEditor

Set the height.

pub fn highlight_syntax(
  te: TextEditor,
  lang: String,
) -> TextEditor

Set the syntax highlighting language.

pub fn highlight_theme(
  te: TextEditor,
  theme: String,
) -> TextEditor

Set the syntax highlighting theme.

pub fn input_purpose(
  te: TextEditor,
  p: input_purpose.InputPurpose,
) -> TextEditor

Set the input purpose hint.

pub fn key_bindings(
  te: TextEditor,
  bindings: List(node.PropValue),
) -> TextEditor

Set declarative key binding rules. Each rule is a DictVal.

pub fn line_height(
  te: TextEditor,
  lh: line_height.LineHeight,
) -> TextEditor

Set the line height.

pub fn max_height(te: TextEditor, h: Float) -> TextEditor

Set the maximum height in pixels.

pub fn min_height(te: TextEditor, h: Float) -> TextEditor

Set the minimum height in pixels.

pub fn new(id: String, content: String) -> TextEditor

Create a new text editor builder.

pub fn padding(te: TextEditor, p: Float) -> TextEditor

Set the padding in pixels.

The renderer’s text_editor widget accepts a scalar thickness only; iced’s text_editor API has no per-side padding.

pub fn placeholder(te: TextEditor, p: String) -> TextEditor

Set the placeholder text.

pub fn placeholder_color(
  te: TextEditor,
  c: color.Color,
) -> TextEditor

Set the placeholder text color.

pub fn required(te: TextEditor, r: Bool) -> TextEditor

Mark this field as required. Flows into a11y.required.

pub fn selection_color(
  te: TextEditor,
  c: color.Color,
) -> TextEditor

Set the selection highlight color.

pub fn size(te: TextEditor, s: Float) -> TextEditor

Set the size.

pub fn style(te: TextEditor, s: String) -> TextEditor

Set the style.

pub fn text_direction(
  te: TextEditor,
  direction: text_direction.TextDirection,
) -> TextEditor

Set the text direction used by logical editor operations.

Placeholder text uses the same direction hint as the editor content.

pub fn validation(
  te: TextEditor,
  v: validation_state.ValidationState,
) -> TextEditor

Set the form-validation state. Flows into a11y.invalid and a11y.error_message automatically.

pub fn width(te: TextEditor, w: length.Length) -> TextEditor

Set the width.

pub fn with_opts(te: TextEditor, opts: List(Opt)) -> TextEditor

Apply a list of options to a text editor builder.

pub fn wrapping(
  te: TextEditor,
  w: wrapping.Wrapping,
) -> TextEditor

Set the text wrapping mode.

Search Document