flex

package
v0.0.0-...-955f326 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2020 License: MPL-2.0 Imports: 5 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 {
	// 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 new flex layout data.

func (*Data) Apply

func (f *Data) Apply(target layout.Layoutable)

Apply the layout data to the target. A copy is made of this data and that is applied to the target, so this data may be applied to other targets.

func (*Data) HAlign

func (f *Data) HAlign(hAlign align.Alignment) *Data

HAlign sets the horizontal alignment of the target within its available space. Defaults to Start.

func (*Data) HGrab

func (f *Data) HGrab(hGrab bool) *Data

HGrab sets whether excess horizontal space should be grabbed. Defaults to false.

func (*Data) HSpan

func (f *Data) HSpan(hSpan int) *Data

HSpan sets the number of columns the target should span. Defaults to 1.

func (*Data) MinSize

func (f *Data) MinSize(minSize geom.Size) *Data

MinSize overrides the minimum size of the target. Defaults to no override (0, 0).

func (*Data) SizeHint

func (f *Data) SizeHint(sizeHint geom.Size) *Data

SizeHint sets a hint requesting a particular size for the target. Defaults to no hint (0, 0).

func (*Data) VAlign

func (f *Data) VAlign(vAlign align.Alignment) *Data

VAlign sets the vertical alignment of the target within its available space. Defaults to Middle.

func (*Data) VGrab

func (f *Data) VGrab(vGrab bool) *Data

VGrab sets whether excess vertical space should be grabbed. Defaults to false.

func (*Data) VSpan

func (f *Data) VSpan(vSpan int) *Data

VSpan sets the number of rows the target should span. Defaults to 1.

type Flex

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

Flex lays out the children of its Layoutable based on the Data assigned to each child.

func New

func New() *Flex

New creates a new Flex layout and sets it on the Layoutable.

func (*Flex) Apply

func (f *Flex) Apply(target layout.Layoutable)

Apply the layout to the target. A copy is made of this layout and that is applied to the target, so this layout may be applied to other targets.

func (*Flex) Columns

func (f *Flex) Columns(columns int) *Flex

Columns sets the number of columns. Defaults to 1.

func (*Flex) EqualColumns

func (f *Flex) EqualColumns(equalColumns bool) *Flex

EqualColumns sets whether each column should use the same amount of horizontal space. Defaults to false.

func (*Flex) HAlign

func (f *Flex) HAlign(hAlign align.Alignment) *Flex

HAlign sets the horizontal alignment of the target within its available space. Defaults to Start.

func (*Flex) HSpacing

func (f *Flex) HSpacing(hSpacing float64) *Flex

HSpacing sets the spacing between columns. Defaults to DefaultHSpacing.

func (*Flex) Layout

func (f *Flex) Layout()

Layout implements the Layout interface.

func (*Flex) Sizes

func (f *Flex) Sizes(hint geom.Size) (min, pref, max geom.Size)

Sizes implements the Layout interface.

func (*Flex) VAlign

func (f *Flex) VAlign(vAlign align.Alignment) *Flex

VAlign sets the vertical alignment of the target within its available space. Defaults to Start.

func (*Flex) VSpacing

func (f *Flex) VSpacing(vSpacing float64) *Flex

VSpacing sets the spacing between rows. Defaults to DefaultVSpacing.

Jump to

Keyboard shortcuts

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