Documentation
¶
Overview ¶
Package outlay provides extra layouts for gio.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Animation ¶
Animation holds state for an Animation between two states that is not invertible.
func (*Animation) Progress ¶
Progress returns the current progress through the animation as a value in the range [0,1]
func (*Animation) SetDuration ¶
type AxisPosition ¶
type AxisPosition struct {
// First and last are the indicies of the first and last visible
// cell on the axis.
First, Last int
// Offset is the pixel offset from the beginning of the first cell to
// the first visible pixel.
Offset int
// OffsetAbs is the estimated absolute position of the first visible
// pixel within the entire axis, mesaured in pixels.
OffsetAbs int
// Length is the estimated total size of the axis, measured in pixels.
Length int
}
AxisPosition describes the position of a viewport on a given axis.
type Cell ¶
type Cell func(gtx layout.Context, row, col int) layout.Dimensions
Cell is the layout function for a grid cell, with row,col parameters.
type Dimensioner ¶
Dimensioner is a function that provides the dimensions (in pixels) of an element on a given axis. The constraint parameter provides the size of the visible portion of the axis for applications that want it.
type Fan ¶
type Fan struct { Animation // The width, in radians, of the full arc that items should occupy. // If zero, math.Pi/2 will be used (1/4 of a full circle). WidthRadians float32 // The offset, in radians, above the X axis to apply before rendering the // arc. This can be used with a value of Pi/4 to center an arc of width // Pi/2. If zero, math.Pi/4 will be used (1/8 of a full circle). To get the // equivalent of specifying zero, specify a value of 2*math.Pi. OffsetRadians float32 // The radius of the hollow circle at the center of the fan. Leave nil to // use the default heuristic of half the width of the widest item. HollowRadius *unit.Dp // contains filtered or unexported fields }
type Flow ¶
type Flow struct { Num int Axis layout.Axis Alignment layout.Alignment // contains filtered or unexported fields }
Flow lays out at most Num elements along the main axis. The number of cross axis elements depend on the total number of elements.
func (*Flow) Layout ¶
func (g *Flow) Layout(gtx layout.Context, num int, el FlowElement) layout.Dimensions
type FlowElement ¶
type FlowElement func(gtx layout.Context, i int) layout.Dimensions
FlowElement lays out the ith element of a Grid.
type FlowWrap ¶
FlowWrap lays out as many elements as possible along the main axis before wrapping to the cross axis.
func (FlowWrap) Layout ¶
func (g FlowWrap) Layout(gtx layout.Context, num int, el FlowElement) layout.Dimensions
type Grid ¶
type Grid struct { Vertical AxisPosition Horizontal AxisPosition Vscroll gesture.Scroll Hscroll gesture.Scroll // LockedRows is a quantity of rows (starting from row 0) to lock to // the top of the grid's viewport. These rows will not be included in // the indicies provided in the Vertical AxisPosition field. LockedRows int }
Grid provides a scrollable two dimensional viewport that efficiently lays out only content visible or nearly visible within the current viewport.
func (*Grid) Layout ¶
func (g *Grid) Layout(gtx layout.Context, rows, cols int, dimensioner Dimensioner, cellFunc Cell) layout.Dimensions
Layout the Grid.
BUG(whereswaldon): all rows are set to the height returned by dimensioner(layout.Vertical, 0, gtx.Constraints.Max.Y). Support for variable-height rows is welcome as a patch.
Notes ¶
Bugs ¶
all rows are set to the height returned by dimensioner(layout.Vertical, 0, gtx.Constraints.Max.Y). Support for variable-height rows is welcome as a patch.