layouts

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAdaptiveGridLayout added in v0.4.0

func NewAdaptiveGridLayout(rowcols int) fyne.Layout

NewAdaptiveGridLayout returns a new grid layout which uses columns when horizontal but rows when vertical.

func NewGridLayout added in v0.4.0

func NewGridLayout(cols int) fyne.Layout

NewGridLayout returns a grid layout arranged in a specified number of columns. The number of rows will depend on how many children are in the container that uses this layout.

func NewGridLayoutWithColumns added in v0.4.0

func NewGridLayoutWithColumns(cols int) fyne.Layout

NewGridLayoutWithColumns returns a new grid layout that specifies a column count and wrap to new rows when needed.

func NewGridLayoutWithColumnsAndPadding added in v0.4.0

func NewGridLayoutWithColumnsAndPadding(cols int, padding float32) fyne.Layout

func NewGridLayoutWithRows added in v0.4.0

func NewGridLayoutWithRows(rows int) fyne.Layout

NewGridLayoutWithRows returns a new grid layout that specifies a row count that creates new rows as required.

Types

type CenterPadLayout

type CenterPadLayout struct {
	PadLeftRight float32
	PadTopBottom float32
}

func (*CenterPadLayout) Layout

func (c *CenterPadLayout) Layout(objects []fyne.CanvasObject, size fyne.Size)

func (*CenterPadLayout) MinSize

func (c *CenterPadLayout) MinSize(objects []fyne.CanvasObject) fyne.Size

only supports one object

type ColumnsLayout

type ColumnsLayout struct {
	ColumnWidths []float32
}

ColumnsLayout lays out a number of items into columns. There are two types of columns: fixed-width and variable width. A fixed width column is any with a non-negative width and will be laid out with that width. A variable width column is created by using any negative number as its width. Variable width columns are all laid out with the same width, splitting the "leftover" space equally between themselves after accounting for the fixed-width columns. Hidden items are not shown and take up 0 space.

func NewColumnsLayout

func NewColumnsLayout(widths []float32) *ColumnsLayout

func (*ColumnsLayout) Layout

func (c *ColumnsLayout) Layout(objects []fyne.CanvasObject, size fyne.Size)

func (*ColumnsLayout) MinSize

func (c *ColumnsLayout) MinSize(objects []fyne.CanvasObject) fyne.Size

type HboxCustomPadding

type HboxCustomPadding struct {
	ExtraPad        float32
	DisableThemePad bool
}

func (*HboxCustomPadding) Layout

func (h *HboxCustomPadding) Layout(objects []fyne.CanvasObject, size fyne.Size)

func (*HboxCustomPadding) MinSize

func (h *HboxCustomPadding) MinSize(objects []fyne.CanvasObject) fyne.Size

type LeftMiddleRightLayout

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

Lays out up to 3 objects such that the middle object, Objects[1], is centered in the available space and takes up a fixed width. The left, and right (if non-nil), split the leftover space equally.

func NewLeftMiddleRightLayout

func NewLeftMiddleRightLayout(middleWidth float32) *LeftMiddleRightLayout

func (*LeftMiddleRightLayout) Layout

func (b *LeftMiddleRightLayout) Layout(objects []fyne.CanvasObject, size fyne.Size)

func (*LeftMiddleRightLayout) MinSize

func (b *LeftMiddleRightLayout) MinSize(objects []fyne.CanvasObject) fyne.Size

type MaxPadLayout

type MaxPadLayout struct {
	PadLeft   float32
	PadRight  float32
	PadTop    float32
	PadBottom float32
}

func (*MaxPadLayout) Layout

func (c *MaxPadLayout) Layout(objects []fyne.CanvasObject, size fyne.Size)

func (*MaxPadLayout) MinSize

func (c *MaxPadLayout) MinSize(objects []fyne.CanvasObject) fyne.Size

only supports one object

type PercentPadLayout added in v0.10.0

type PercentPadLayout struct {
	LeftRightObjectPercent float32
	TopBottomObjectPercent float32
}

Centers and pads a given item by a percent (0-1) of the width and height that should be taken by the objects

func (*PercentPadLayout) Layout added in v0.10.0

func (l *PercentPadLayout) Layout(objects []fyne.CanvasObject, size fyne.Size)

func (*PercentPadLayout) MinSize added in v0.10.0

func (l *PercentPadLayout) MinSize(objects []fyne.CanvasObject) fyne.Size

type VboxCustomPadding

type VboxCustomPadding struct {
	ExtraPad float32
}

func (*VboxCustomPadding) Layout

func (v *VboxCustomPadding) Layout(objects []fyne.CanvasObject, size fyne.Size)

func (*VboxCustomPadding) MinSize

func (v *VboxCustomPadding) MinSize(objects []fyne.CanvasObject) fyne.Size

Jump to

Keyboard shortcuts

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