Documentation
¶
Overview ¶
Package editorstyle supplies the shared input appearance for widget and el.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Composition ¶
Composition paints the composing text's underline and returns its visible bounds in editor coordinates for the platform candidate window. Adapters that consume CompositionEvent themselves must call this after editor layout.
func InlineFont ¶
func InlineFont(name font.Typeface, metrics InlineFontMetrics, glyphs []InlineGlyph) (font.FontFace, error)
InlineFont creates an owned, outline-free font containing only the supplied private-use runes. Include it ahead of normal text fonts in an editor-local shaper. Never register this font globally: rune mappings are document-local. Glyphs need not be sorted; duplicate/non-private runes and invalid metrics fail.
Types ¶
type Caret ¶
type Caret struct {
// contains filtered or unexported fields
}
Caret retains blink, caret and selection ink measurements for one editor.
func (*Caret) InputMethodCaret ¶
InputMethodCaret uses the same ink metrics and baseline as the visible caret. Call after Layout, when the editor's scrolled geometry and font metrics exist.
func (*Caret) Layout ¶
func (c *Caret) Layout(gtx layout.Context, style material.EditorStyle, shaper *text.Shaper) layout.Dimensions
Layout draws an editor with ink-height selection and caret at Gio's actual coordinates. The caller MUST drain Editor.Update first, handling its change and submit events. Gio 0.10 has no separate caret paint hook: ReadOnly is set only during drawing to suppress its font-line-height caret, then restored. Input, selection, scrolling, undo and IME still belong to the original Editor.
func (*Caret) LayoutDecorated ¶
func (c *Caret) LayoutDecorated(gtx layout.Context, style material.EditorStyle, shaper *text.Shaper, decorate func(layout.Context)) layout.Dimensions
LayoutDecorated adds editor-coordinate backgrounds after text layout and before selection and glyph painting. The decoration must not change layout.