layouthelp

package
v0.0.0-...-a59fafb Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package layouthelp has a few utilities for helping with custom layouts or widgets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccumulateHeight

func AccumulateHeight(sizes ...fyne.Size) fyne.Size

AccumulateHeight will add all heights together and return a fyne.Size with the sum height and max width. This is useful for defining MinSize of fyne.CanvasObjects in a column.

func AccumulateWidth

func AccumulateWidth(sizes ...fyne.Size) fyne.Size

AccumulateWidth will add all widths together and return a fyne.Size with the sum width and max height. This is useful for defining MinSize of fyne.CanvasObjects in a row.

func Margin

func Margin(obj fyne.CanvasObject, top, right, bottom, left float32) fyne.CanvasObject

Margin allows specifying padding individually on all sides.

func MarginAll

func MarginAll(obj fyne.CanvasObject, all float32) fyne.CanvasObject

MarginAll adds the specified padding on all sides of the object.

func MarginLeftRight

func MarginLeftRight(obj fyne.CanvasObject, left, right float32) fyne.CanvasObject

MarginLeftRight allows specifying left and right padding, but leaves top and bottom at zero.

func MarginTopBottom

func MarginTopBottom(obj fyne.CanvasObject, top, bottom float32) fyne.CanvasObject

MarginTopBottom allows specifying top and bottom padding, but leaves left and right at zero.

func MarginXY

func MarginXY(obj fyne.CanvasObject, x, y float32) fyne.CanvasObject

MarginXY adds padding to both sides of each axis, 'x' specifies horizontal padding and 'y' specifies vertical.

Types

type MultiView

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

MultiView allows different fyne.CanvasObjects to be displayed in the same area of a layout. It can be used as either a stack which allows pushing an object for a separate task and popping it off to return to the previous view, or as a replacement target that discards the existing canvas object instead.

func NewMultiView

func NewMultiView() *MultiView

NewMultiView should be used to initialize a MultiView.

func (*MultiView) Clear

func (v *MultiView) Clear()

Clear removes all objects from the stack and the container.

func (*MultiView) Container

func (v *MultiView) Container() *fyne.Container

Container gets the configured container which can be manipulated through the MultiView.

func (*MultiView) Pop

func (v *MultiView) Pop()

Pop pops the top canvas object off the view stack and replaces the container content with the next if there is one.

func (*MultiView) Push

func (v *MultiView) Push(obj fyne.CanvasObject)

Push adds the provided canvas object to the top of the view stack and replaces the container content with it.

func (*MultiView) Replace

func (v *MultiView) Replace(obj fyne.CanvasObject)

Replace replaces the currently displayed fyne.CanvasObject (if any) with the provided object.

Jump to

Keyboard shortcuts

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