Module text

Module text 

Source
Expand description

Text widgets display information through writing.

Keyboard shortcuts (applies to both Text and Rich):

MacOSLinux/WindowsEffect
Cmd + ACtrl + ASelects all text in the currently focused paragraph
Cmd + CCtrl + CCopies the selected text to clipboard
Shift + Left ArrowShift + Left ArrowMoves the selection to the left by one character
Shift + Right ArrowShift + Right ArrowMoves the selection to the right by one character
Shift + Opt + Left ArrowShift + Ctrl + Left ArrowExtends the selection to the previous start of a word
Shift + Opt + Right ArrowShift + Ctrl + Right ArrowExtends the selection to the next end of a word
Shift + Home
Shift + Cmd + Left Arrow
Shift + Opt + Up Arrow
Shift + Home
Shift + Ctrl + Up Arrow
Selects to the beginning of the line
Shift + End
Shift + Cmd + Right Arrow
Shift + Opt + Down Arrow
Shift + End
Shift + Ctrl + Down Arrow
Selects to the end of the line
Shift + Up ArrowShift + Up ArrowMoves the selection up by one line if possible, or to the start of the current line otherwise
Shift + Down ArrowShift + Down ArrowMoves the selection down by one line if possible, or to the end of the current line otherwise
Shift + Opt + Home
Shift + Cmd + Up Arrow
Shift + Ctrl + HomeSelects to the beginning of the paragraph
Shift + Opt + End
Shift + Cmd + Down Arrow
Shift + Ctrl + EndSelects to the end of the paragraph

Structs§

Rich
A bunch of Rich text.
Span
A span of text.
State
The internal state of a Text widget.
Style
The appearance of some text.
Text
A bunch of text.

Enums§

Dragging
The type of dragging selection.

Traits§

Catalog
The theme catalog of a Text.
Highlighter
A type capable of highlighting text.
IntoFragment
A trait for converting a value to some text Fragment.

Functions§

default
The default text styling; color is inherited.
draw
Draws text using the same logic as the Text widget.
layout
Produces the layout::Node of a Text widget.

Type Aliases§

Fragment
A fragment of [Text].
StyleFn
A styling function for a Text.