layouts

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct{}

func (Column) Arrange

func (Column) Arrange(hints tomo.LayoutHints, boxes []tomo.Box)

func (Column) MinimumSize

func (Column) MinimumSize(hints tomo.LayoutHints, boxes []tomo.Box) image.Point

type Cut

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

Cut is a layout that can be divided into smaller and smaller sections.

func NewCut added in v0.4.0

func NewCut() *Cut

NewCut creates and returns a new Cut layout.

func (*Cut) Arrange

func (this *Cut) Arrange(hints tomo.LayoutHints, boxes []tomo.Box)

func (*Cut) At added in v0.4.0

func (this *Cut) At(index int) *Cut

At returns the section of this layout at the specified index.

func (*Cut) Horizontal

func (this *Cut) Horizontal(expand ...bool)

Horizontal divides the layout horizontally. Sections are specified using booleans. If a section is true, it will expand. If false, it will contract.

func (*Cut) MinimumSize

func (this *Cut) MinimumSize(hints tomo.LayoutHints, boxes []tomo.Box) image.Point

func (*Cut) Vertical

func (this *Cut) Vertical(expand ...bool)

Vertical divides the layout vertically. Sections are specified using booleans. If a section is true, it will expand. If false, it will contract.

type Grid added in v0.4.0

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

Grid is a layout that arranges boxes in a grid formation with distinct rows and columns. It is great for creating forms.

func NewGrid added in v0.4.0

func NewGrid(columns, rows []bool) *Grid

NewGrid creates a new grid layout. Rows and columns are specified as slices of booleans, where true means a row or column will expand and false means it will contract. Boxes are laid out left to right, then top to bottom. Boxes that go beyond the lengh of rows will be laid out according to columns, but they will not expand vertically.

func (*Grid) Arrange added in v0.4.0

func (this *Grid) Arrange(hints tomo.LayoutHints, boxes []tomo.Box)

func (*Grid) MinimumSize added in v0.4.0

func (this *Grid) MinimumSize(hints tomo.LayoutHints, boxes []tomo.Box) image.Point

type Row

type Row struct{}

func (Row) Arrange

func (Row) Arrange(hints tomo.LayoutHints, boxes []tomo.Box)

func (Row) MinimumSize

func (Row) MinimumSize(hints tomo.LayoutHints, boxes []tomo.Box) image.Point

Jump to

Keyboard shortcuts

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