Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Background ¶
Background lays out a widget over a colored background.
func (Background) Layout ¶
func (bg Background) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions
type D ¶
type D = layout.Dimensions
type GutterStyle ¶
GutterStyle configures a gutter on either side of a horizontal row of content. Both sides can optionally display a widget atop the gutter space.
func Gutter ¶
func Gutter() GutterStyle
Gutter returns a GutterStyle with a narrow left gutter and a wide right gutter.
func (GutterStyle) Layout ¶
func (g GutterStyle) Layout(gtx layout.Context, left, center, right layout.Widget) layout.Dimensions
Layout the gutter with the left and right widgets laid out atop the gutter areas and the center widget in the remaining space in between. Left or right may be provided as nil to indicate that nothing should be displayed in the gutter.
type Row ¶
type Row struct { // Margin between rows. Margin VerticalMarginStyle // InternalMargin between internal rows. // Leave unset if you want to control spacing between RowChild individually. InternalMargin VerticalMarginStyle // Gutter handles the left-right gutters of the row that provides padding and // can contain other widgets. Gutter GutterStyle // Direction of widgets within this row. // Typically, non-local widgets are aligned W, and local widgets aligned E. Direction layout.Direction }
Row lays out a central widget with gutters either side. The central widget can be arbitrarily aligned and gutters can have supplimentary widgets stacked atop them.
type RowChild ¶
RowChild specifies a content widget and two gutter widgets either side. RowChild is used to layout composite rows made up of any number of interal rows.
func ContentRow ¶
ContentRow returns a RowChild that lays out a content with no gutter widgets.
func FullRow ¶
FullRow returns a RowChild that lays out content with optional gutter widgets either side.
func UnifiedRow ¶
UnifiedRow ignores gutters, taking up all available space.
type VerticalMarginStyle ¶
VerticalMarginStyle provides a simple API for insetting a widget equally on its top and bottom edges. Consistently wrapping chat elements in a single VerticalMarginStyle as their outermost layout type will ensure that they are spaced evenly and no part of their content crowds that of the message above and below.
func VerticalMargin ¶
func VerticalMargin() VerticalMarginStyle
VerticalMargin configures a vertical margin with a sensible default margin.
func (VerticalMarginStyle) Layout ¶
func (v VerticalMarginStyle) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions
Layout the provided widget within the margin and return their combined dimensions.