layout

package
v0.5.53 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	AlignNoneV    = 0
	AlignLeftV    = 1
	AlignRightV   = 2
	AlignHCenterV = 3
	AlignTopV     = 4
	AlignBottomV  = 5
	AlignVCenterV = 6
	AlignCenterV  = 7
)

Alignment constants for VStack/HStack

Variables

This section is empty.

Functions

func HasAnchorsOnChild

func HasAnchorsOnChild(child interface{}) bool

func HasAnyAnchor

func HasAnyAnchor(anchors *Anchors) bool

Types

type AlignItems

type AlignItems string
const (
	AlignStretch AlignItems = "stretch"
	AlignStart   AlignItems = "start"
	AlignCenter  AlignItems = "center"
	AlignEnd     AlignItems = "end"
)

type AnchorLayout

type AnchorLayout struct{}

func NewAnchorLayout

func NewAnchorLayout() *AnchorLayout

func (*AnchorLayout) Layout

func (a *AnchorLayout) Layout(target interface{}, rect graphics.Rect)

func (*AnchorLayout) PreferredDimensions

func (a *AnchorLayout) PreferredDimensions(target interface{}, w, h float32) (float32, float32)

type AnchorLine

type AnchorLine struct {
	Target Widget
	Line   AnchorLineType
}

type AnchorLineType

type AnchorLineType int
const (
	AnchorTop AnchorLineType = iota
	AnchorBottom
	AnchorLeft
	AnchorRight
	AnchorHCenter
	AnchorVCenter
	AnchorBaseline
)

type Anchors

type Anchors struct {
	Left, Right, Top, Bottom         *AnchorLine
	HorizontalCenter, VerticalCenter *AnchorLine
	Fill, CenterIn                   Widget
	Margins                          float32
	LeftMargin, RightMargin          float32
	TopMargin, BottomMargin          float32
	HCenterOffset, VCenterOffset     float32
	// Internal: parent object for QML-compliant resolution
	ParentObj interface{} // *qml.Object, stored as interface{} to avoid import cycle
	// Resolver function to get Widget from ParentObj (set by qml package)
	ResolveParentWidget func(obj interface{}) Widget
}

func NewAnchors

func NewAnchors() *Anchors

type Flex

type Flex struct {
	Direction FlexDirection
	Justify   JustifyContent
	Align     AlignItems
	Spacing   float32
	Wrap      bool
	// contains filtered or unexported fields
}

func NewFlex

func NewFlex() *Flex

func (*Flex) Layout

func (f *Flex) Layout(target interface{}, rect graphics.Rect)

func (*Flex) PreferredDimensions

func (f *Flex) PreferredDimensions(target interface{}, w, h float32) (float32, float32)

type FlexDirection

type FlexDirection string
const (
	FlexRow    FlexDirection = "row"
	FlexColumn FlexDirection = "column"
)

type Grid

type Grid struct {
	Columns int
	Spacing float32
	// contains filtered or unexported fields
}

func NewGrid

func NewGrid(columns int) *Grid

func (*Grid) Layout

func (g *Grid) Layout(target interface{}, rect graphics.Rect)

func (*Grid) PreferredDimensions

func (g *Grid) PreferredDimensions(target interface{}, w, h float32) (float32, float32)

type HStack

type HStack struct {
	Spacing float32
	// contains filtered or unexported fields
}

func NewHStack

func NewHStack() *HStack

func (*HStack) Layout

func (h *HStack) Layout(target interface{}, rect graphics.Rect)

func (*HStack) PreferredDimensions

func (h *HStack) PreferredDimensions(target interface{}, w, hVal float32) (float32, float32)

type JustifyContent

type JustifyContent string
const (
	JustifyStart        JustifyContent = "start"
	JustifyCenter       JustifyContent = "center"
	JustifyEnd          JustifyContent = "end"
	JustifySpaceBetween JustifyContent = "space-between"
	JustifySpaceAround  JustifyContent = "space-around"
)

type LayoutProps

type LayoutProps struct {
	FillWidth       bool
	FillHeight      bool
	PreferredWidth  float32
	PreferredHeight float32
	MinimumWidth    float32
	MaximumWidth    float32
	MinimumHeight   float32
	MaximumHeight   float32
	LeftMargin      float32
	RightMargin     float32
	TopMargin       float32
	BottomMargin    float32
	Alignment       int
}

func NewLayoutProps

func NewLayoutProps() *LayoutProps

type VStack

type VStack struct {
	Spacing float32
	// contains filtered or unexported fields
}

func NewVStack

func NewVStack() *VStack

func (*VStack) Layout

func (l *VStack) Layout(target interface{}, rect graphics.Rect)

func (*VStack) PreferredDimensions

func (l *VStack) PreferredDimensions(target interface{}, w, h float32) (float32, float32)

type Widget

type Widget interface{}

Jump to

Keyboard shortcuts

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