layout

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Some extra layouts for Gioui.

ListWrap is copied from https://git.sr.ht/~pierrec/giox. All rights are reversed to the author.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Swap

func Swap(a layout.Axis) layout.Axis

Types

type ListWrap added in v0.6.0

type ListWrap struct {
	Axis      layout.Axis
	Alignment layout.Alignment
	// contains filtered or unexported fields
}

ListWrap lays out as many items as possible along the main axis before wrapping to the cross axis.

The number of items along the main axis must be the same for all rows or columns on the cross axis.

func (*ListWrap) Layout added in v0.6.0

func (*ListWrap) Position added in v0.6.0

func (l *ListWrap) Position() layout.Position

func (*ListWrap) ScrollBy added in v0.6.0

func (l *ListWrap) ScrollBy(num float32)

type WrappedListElement

type WrappedListElement func(layout.Context, int, layout.Dimensions, op.CallOp) layout.Dimensions

ListElement is called for each row/column with the CallOp containing all the elements to be displayed for that row/column and their combined dimensions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳