layouts

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: GPL-3.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contract added in v0.12.0

type Contract bool

Contract is a layout that arranges boxes in a simple row or column according to their minimum sizes.

const ContractHorizontal Contract = false

ContractHorizontal is a horizontal contracted layout.

const ContractVertical Contract = true

ContractVertical is a vertical contracted layout.

func (Contract) Arrange added in v0.12.0

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

func (Contract) MinimumSize added in v0.12.0

func (contract Contract) 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 Flow added in v0.12.0

type Flow bool

Flow is a grid layout where the number of rows and columns changes depending on the size of the container. It is designed to be used with an overflowing container. If the container does not overflow in the correct direction, the layout will behave like Contract.

const FlowHorizontal Flow = false

FlowHorizontal is a horizontal flow layout.

const FlowVertical Flow = true

FlowVertical is a vertical flow layout.

func (Flow) Arrange added in v0.12.0

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

func (Flow) MinimumSize added in v0.12.0

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

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

Jump to

Keyboard shortcuts

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