layout

package
v0.0.0-...-6902453 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Layout

func Layout(ops *op.Ops, do func(ops *op.Ops))

func PostLayout

func PostLayout(ops *op.Ops, do func(ops *op.Ops))

func PrintBoundingRectTo

func PrintBoundingRectTo(w io.Writer, n node.Node)

Types

type AlignGetter

type AlignGetter interface {
	Align() Alignment
}

type AlignSetter

type AlignSetter interface {
	SetAlign(align Alignment)
}

type Aligner

type Aligner struct {
	Alignment Alignment
}

func (*Aligner) Align

func (a *Aligner) Align() Alignment

func (*Aligner) Eq

func (r *Aligner) Eq(v *Aligner) cmp.Result

func (*Aligner) SetAlign

func (a *Aligner) SetAlign(alignment Alignment)

type Alignment

type Alignment = alignment.Alignment

type Arrangement

type Arrangement = arrangement.Arrangement

type ArrangementSetter

type ArrangementSetter interface {
	SetArrangement(Arrangement Arrangement)
}

type Arrangementer

type Arrangementer struct {
	Arrangement Arrangement
}

func (*Arrangementer) Eq

func (*Arrangementer) SetArrangement

func (a *Arrangementer) SetArrangement(arrangement Arrangement)

type BoundingRect

type BoundingRect struct {
	X, Y          unit.Dp
	Width, Height unit.Dp
}

func GetBoundingClientRect

func GetBoundingClientRect(n node.Node) (boundingRect BoundingRect)

func GetBoundingRect

func GetBoundingRect(n node.Node) (boundingRect BoundingRect)

func (BoundingRect) Contains

func (r BoundingRect) Contains(pt unit.Point) bool

func (BoundingRect) String

func (r BoundingRect) String() string

type BoundingRectGetter

type BoundingRectGetter interface {
	BoundingRect() BoundingRect
}

type Clip

type Clip struct {
	Enabled bool
}

func (*Clip) SetClip

func (c *Clip) SetClip(enabled bool)

type ClipSetter

type ClipSetter interface {
	SetClip(enabled bool)
}

type Constraints

type Constraints = layout.Constraints

type Context

type Context = layout.Context

type Dimensions

type Dimensions = layout.Dimensions

type EdgeInset

type EdgeInset layout.Inset

func (*EdgeInset) EdgeInsetOffset

func (c *EdgeInset) EdgeInsetOffset() Offset

func (*EdgeInset) Eq

func (r *EdgeInset) Eq(v *EdgeInset) cmp.Result

func (*EdgeInset) SetEdgeInset

func (c *EdgeInset) SetEdgeInset(dp unit.Dp, positions ...position.Position)

type EdgeInsetOffsetGetter

type EdgeInsetOffsetGetter interface {
	EdgeInsetOffset() Offset
}

type EdgeInsetSetter

type EdgeInsetSetter interface {
	SetEdgeInset(dp unit.Dp, positions ...position.Position)
}

type FlexWeight

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

func (*FlexWeight) Eq

func (r *FlexWeight) Eq(v *FlexWeight) cmp.Result

func (*FlexWeight) SetWeight

func (w *FlexWeight) SetWeight(weight float32)

func (*FlexWeight) Weight

func (w *FlexWeight) Weight() (float32, bool)

type Offset

type Offset struct {
	X unit.Dp
	Y unit.Dp
}

func (*Offset) Eq

func (s *Offset) Eq(v *Offset) cmp.Result

func (*Offset) IsZero

func (c *Offset) IsZero() bool

func (*Offset) SetOffset

func (c *Offset) SetOffset(dp unit.Dp, directions ...direction.Direction)

type OffsetSetter

type OffsetSetter interface {
	SetOffset(dp unit.Dp, directions ...direction.Direction)
}

type Phase

type Phase int
const (
	PhaseBeforeSize Phase = iota
	PhaseDidSize

	PhaseBeforePosition
	PhaseDidPosition
)

type PhaseHandler

type PhaseHandler = event.Handler[Phase]

func OnBeforePosition

func OnBeforePosition(action func()) PhaseHandler

func OnBeforeSize

func OnBeforeSize(action func()) PhaseHandler

func OnDidPosition

func OnDidPosition(action func()) PhaseHandler

func OnDidSize

func OnDidSize(action func()) PhaseHandler

type PhaseHandlersSetter

type PhaseHandlersSetter interface {
	SetPhaseHandlers(handlers ...PhaseHandler)
}

type PhaseRecorder

type PhaseRecorder struct {
	event.Events[Phase]
	// contains filtered or unexported fields
}

func (*PhaseRecorder) BoundingRect

func (d *PhaseRecorder) BoundingRect() BoundingRect

func (*PhaseRecorder) PositionBy

func (d *PhaseRecorder) PositionBy(calc func() (x unit.Dp, y unit.Dp))

func (*PhaseRecorder) RecordPosition

func (d *PhaseRecorder) RecordPosition(x unit.Dp, y unit.Dp)

func (*PhaseRecorder) RecordSize

func (d *PhaseRecorder) RecordSize(w unit.Dp, h unit.Dp)

func (*PhaseRecorder) SetPhaseHandlers

func (d *PhaseRecorder) SetPhaseHandlers(handlers ...PhaseHandler)

type PositionSetter

type PositionSetter interface {
	SetPosition(position position.Position)
}

type Positioner

type Positioner struct {
	Position position.Position
}

func (*Positioner) Eq

func (p *Positioner) Eq(v *Positioner) cmp.Result

func (*Positioner) SetPosition

func (p *Positioner) SetPosition(position position.Position)

type Scrollable

type Scrollable struct {
	Enabled bool
	Axis    direction.Axis
}

func (*Scrollable) Eq

func (s *Scrollable) Eq(v *Scrollable) cmp.Result

func (*Scrollable) SetScrollable

func (s *Scrollable) SetScrollable(axis direction.Axis, enabled bool)

type ScrollableSetter

type ScrollableSetter interface {
	SetScrollable(axis direction.Axis, enabled bool)
}

type Spacer

type Spacer struct {
	Spacing unit.Dp
}

func (*Spacer) Eq

func (s *Spacer) Eq(v *Spacer) cmp.Result

func (*Spacer) SetSpacing

func (s *Spacer) SetSpacing(dp unit.Dp)

type SpacingSetter

type SpacingSetter interface {
	SetSpacing(dp unit.Dp)
}

type WeightGetter

type WeightGetter interface {
	Weight() (float32, bool)
}

type WeightSetter

type WeightSetter interface {
	SetWeight(weight float32)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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