lay

package
v0.0.0-...-ec39e06 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Padding

type Padding struct {
	N, E, S, W Scale
}

func (Padding) Layout

func (p Padding) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions

type Palette

type Palette struct {
	Fg color.NRGBA
	Bg color.NRGBA
}

type Scale

type Scale int8
const (
	None Scale = -0x7f

	Smaller Scale = -2
	Small   Scale = -1
	Default Scale = 0
	Big     Scale = 1
	Bigger  Scale = 1
)

func (Scale) Value

func (s Scale) Value(base unit.Sp, ratio ScaleRatio) unit.Sp

type ScaleRatio

type ScaleRatio = unit.Sp

type Scroll

type Scroll struct {
	Position int
}

type Stack

type Stack struct {
	Gap Scale
}

func (Stack) Layout

func (stack Stack) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions

type Theme

type Theme struct {
	Shaper *text.Shaper

	Base      unit.Sp
	BaseRatio ScaleRatio

	TextSize   unit.Sp
	LineHeight unit.Sp
	TextRatio  ScaleRatio

	Palette

	FingerSize unit.Dp
}

func NewTheme

func NewTheme(fontCollection []text.FontFace) *Theme

func (*Theme) Colorize

func (th *Theme) Colorize(fg, bg color.NRGBA) *Theme

func (*Theme) Scale

func (th *Theme) Scale(modifier float32) *Theme

Jump to

Keyboard shortcuts

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