Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FlexDirection ¶
type FlexDirection int
const ( FlexHorizontal FlexDirection = iota FlexVertical )
type FlexItem ¶
type FlexItem struct {
vxfw.Widget
// Flex determines how much space the widget takes in the layout.
// Flex of 0 means the widget will be its inherent size.
// Remaining space is divided proportionally to all FlexItems with Flex > 0
Flex uint8
}
FlexItem is a vxfw.Widget used in a FlexLayout
func MustSpacer ¶
MustSpacer is like NewSpacer, but panics if flex is less than 1.
type FlexLayout ¶
type FlexLayout struct {
Children []*FlexItem
Direction FlexDirection
}
func (*FlexLayout) Draw ¶
func (w *FlexLayout) Draw(ctx vxfw.DrawContext) (vxfw.Surface, error)
func (*FlexLayout) HandleEvent ¶
func (w *FlexLayout) HandleEvent(_ vaxis.Event, _ vxfw.EventPhase) (vxfw.Command, error)
type Spacer ¶
type Spacer struct{}
Spacer is a vxfw.Widget that takes up available space. It should be used in a FlexItem with a flex of at least 1. Use NewSpacer or MustSpacer for a FlexItem that can be passed directly to FlexLayout
func (Spacer) HandleEvent ¶
Click to show internal directories.
Click to hide internal directories.