flex

package
v0.0.0-...-af996ba Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2019 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	HSpan    int             // Number of columns the widget should span
	VSpan    int             // Number of rows the widget should span
	SizeHint geom.Size       // Hint requesting a particular size of the widget
	MinSize  geom.Size       // Override for the minimum size of the widget
	HAlign   align.Alignment // Horizontal alignment of the widget within its space
	VAlign   align.Alignment // Vertical alignment of the widget within its space
	HGrab    bool            // Grab excess horizontal space if true
	VGrab    bool            // Grab excess vertical space if true
	// contains filtered or unexported fields
}

Data is used to control how an object is laid out by the Flex layout.

func NewData

func NewData() *Data

NewData creates a new Data.

func (*Data) Clone

func (data *Data) Clone() *Data

Clone the Data.

type Layout

type Layout struct {
	Columns      int             // Number of columns
	HSpacing     float64         // Horizontal spacing between columns
	VSpacing     float64         // Vertical spacing between rows
	HAlign       align.Alignment // Horizontal alignment of the widget within its space
	VAlign       align.Alignment // Vertical alignment of the widget within its space
	EqualColumns bool            // Each column uses the same amount of horizontal space if true
	// contains filtered or unexported fields
}

Layout lays out the children of its widget based on the Data assigned to each child.

func NewLayout

func NewLayout(widget ui.Widget) *Layout

NewLayout creates a new Flex layout and sets it on the widget.

func (*Layout) Layout

func (l *Layout) Layout()

Layout implements the Layout interface.

func (*Layout) Sizes

func (l *Layout) Sizes(hint geom.Size) (min, pref, max geom.Size)

Sizes implements the Layout interface.

Jump to

Keyboard shortcuts

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