widget

package
v0.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2025 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEditor

func NewEditor(th *material.Theme) *gvcode.Editor

NewEditor is a helper function to setup a editor with the provided theme.

Types

type RichTextLabel added in v0.3.0

type RichTextLabel struct {
	// Face defines the text style.
	Font font.Font
	// Text is the content displayed by the label.
	Text string
	// TextSize determines the size of the text glyphs.
	TextSize unit.Sp
	// Alignment specifies the text alignment.
	Alignment text.Alignment
	// WrapPolicy configures how displayed text will be broken into lines.
	WrapLine bool
	// LineHeight controls the distance between the baselines of lines of text.
	// If zero, a sensible default will be used.
	LineHeight unit.Sp
	// LineHeightScale applies a scaling factor to the LineHeight. If zero, a
	// sensible default will be used.
	LineHeightScale float32
	// contains filtered or unexported fields
}

RichTextLabel is a widget for laying out and drawing rich text.

func Label added in v0.3.0

func Label(th *material.Theme, size unit.Sp, txt string) RichTextLabel

func (*RichTextLabel) Layout added in v0.3.0

func (l *RichTextLabel) Layout(gtx layout.Context) layout.Dimensions

Layout the label with the given shaper, font, size, text, and material, returning metadata about the shaped text.

func (*RichTextLabel) SetColorScheme added in v0.3.0

func (l *RichTextLabel) SetColorScheme(cs *syntax.ColorScheme)

func (*RichTextLabel) SetText added in v0.3.0

func (l *RichTextLabel) SetText(text string, textStyles []syntax.Token, decorations []decoration.Decoration)

func (*RichTextLabel) Update added in v0.3.0

func (l *RichTextLabel) Update(gtx layout.Context)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL