layout

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Bold = 1 << iota
	Italic
	Underline
)
View Source
const (
	UnitPx UnitType = iota
	UnitPercent
	UnitGrow

	JCenter JustifyContent = iota
	JLeft
	JRight

	ACenter AlignItems = iota
	ATop
	ABottom
	ALeft
	ARight

	Column Direction = iota
	Row
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AlignItems

type AlignItems int

type Color

type Color struct {
	// contains filtered or unexported fields
}

type Component

type Component interface {
	Styler

	IsDirty() bool
	MakeDirty()
	ClearDirty()

	Layout(x, y, w, h int)
	Render(screen *screen.Screen)

	SetParent(parent Component)
}

Main interface for all layout components

type Direction

type Direction int

type JustifyContent

type JustifyContent int

type Padding

type Padding struct {
	Top    Unit
	Bottom Unit
	Left   Unit
	Right  Unit
}

type Style

type Style struct {
	TextDecoration TextDecoration
	// contains filtered or unexported fields
}

func (*Style) AddTextDecoration

func (s *Style) AddTextDecoration(d TextDecoration)

func (Style) GetBackground

func (s Style) GetBackground() string

func (Style) GetDecor

func (s Style) GetDecor() string

func (Style) GetForeground

func (s Style) GetForeground() string

func (Style) GetTextDecoration

func (s Style) GetTextDecoration() TextDecoration

func (Style) HasTextDecoration

func (s Style) HasTextDecoration(d TextDecoration) bool

func (*Style) RemoveTextDecoration

func (s *Style) RemoveTextDecoration(d TextDecoration)

func (*Style) SetBackground

func (s *Style) SetBackground(r, g, b uint8)

func (*Style) SetForeground

func (s *Style) SetForeground(r, g, b uint8)

type Styler

type Styler interface {
	GetStyle() Style
}

type TextDecoration

type TextDecoration uint8

type Unit

type Unit struct {
	Type  UnitType
	Value float64
}

func (Unit) Resolve

func (u Unit) Resolve(total int) int

type UnitType

type UnitType int

Jump to

Keyboard shortcuts

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