ltk

Module text_edit

Source
Expand description

Text input field — single-line or multiline. The widget itself owns layout / draw; the runtime side of text editing (insert, delete, cursor movement, selection, clipboard) lives in the event_loop::text_editing private module.

Structs§

  • Resolve the font size into a concrete logical px. Some( len ) resolves against Canvas::viewport_logical — the font space, so × dpi_scale at raster yields the right physical size — exactly like the button label; None follows the widget-scaling mode at the theme default. Shared by the draw and hit-test paths, which all carry a canvas. A run of a multiline field’s value drawn in a colour of its own, as a syntax highlighter marks keywords, strings and comments. range is in bytes of the value and should fall on character boundaries; runs are expected in order and not overlapping, and what no run covers takes the field’s colour.
  • A text input field.

Functions§

  • Hit rect for the eye icon at the right edge of a TextEdit configured with TextEdit::password_toggle. Returned in the same coordinate space as the field’s rect. Pointer / touch dispatch consult this before falling through to cursor placement — a tap inside the zone fires the toggle message instead of moving the caret.