layout

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2019 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package layout defines the various layouts available to Fyne apps

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBorderLayout

func NewBorderLayout(top, bottom, left, right fyne.CanvasObject) fyne.Layout

NewBorderLayout creates a new BorderLayout instance with top, left, bottom and right objects set. All other items in the container will fill the centre space

func NewFixedGridLayout

func NewFixedGridLayout(size fyne.Size) fyne.Layout

NewFixedGridLayout returns a new FixedGridLayout instance

func NewFormLayout

func NewFormLayout() fyne.Layout

NewFormLayout returns a new FormLayout instance

func NewGridLayout

func NewGridLayout(cols int) fyne.Layout

NewGridLayout returns a new GridLayout instance

func NewHBoxLayout

func NewHBoxLayout() fyne.Layout

NewHBoxLayout returns a horizontal box layout for stacking a number of child canvas objects or widgets left to right.

func NewMaxLayout

func NewMaxLayout() fyne.Layout

NewMaxLayout creates a new MaxLayout instance

func NewSpacer

func NewSpacer() fyne.CanvasObject

NewSpacer returns a spacer object which can fill vertical and horizontal space. This is primarily used with a box layout.

func NewVBoxLayout

func NewVBoxLayout() fyne.Layout

NewVBoxLayout returns a vertical box layout for stacking a number of child canvas objects or widgets top to bottom.

Types

type Spacer

type Spacer struct {
	FixHorizontal bool
	FixVertical   bool
	// contains filtered or unexported fields
}

Spacer is any simple object that can be used in a box layout to space out child objects

func (*Spacer) ExpandHorizontal

func (s *Spacer) ExpandHorizontal() bool

ExpandHorizontal returns whether or not this spacer expands on the horizontal axis

func (*Spacer) ExpandVertical

func (s *Spacer) ExpandVertical() bool

ExpandVertical returns whether or not this spacer expands on the vertical axis

func (*Spacer) Hide

func (s *Spacer) Hide()

Hide removes this Spacer from layout calculations

func (*Spacer) MinSize

func (s *Spacer) MinSize() fyne.Size

MinSize returns a 0 size as a Spacer can shrink to no actual size

func (*Spacer) Move

func (s *Spacer) Move(pos fyne.Position)

Move sets a new position for the Spacer - this will be called by the layout

func (*Spacer) Position

func (s *Spacer) Position() fyne.Position

Position returns the current position of this Spacer

func (*Spacer) Resize

func (s *Spacer) Resize(size fyne.Size)

Resize sets a new size for the Spacer - this will be called by the layout

func (*Spacer) Show

func (s *Spacer) Show()

Show sets the Spacer to be part of the layout calculations

func (*Spacer) Size

func (s *Spacer) Size() fyne.Size

Size returns the current size of this Spacer

func (*Spacer) Visible

func (s *Spacer) Visible() bool

Visible returns true if this spacer should affect the layout

type SpacerObject

type SpacerObject interface {
	ExpandVertical() bool
	ExpandHorizontal() bool
}

SpacerObject is any object that can be used to space out child objects

Jump to

Keyboard shortcuts

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