layout

package
v0.0.0-...-1f16367 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Background

type Background color.NRGBA

Background lays out a widget over a colored background.

func (Background) Layout

type DetailRow

type DetailRow struct {
	// PrimaryWidth is the fraction of the available width that should
	// be allocated to the primary widget. It should be in the range
	// (0,1.0]. Defaults to 0.3 if not set.
	PrimaryWidth float32
	// Inset is automatically applied to both widgets. This inset is
	// required, and will default to a uniform 8DP inset if not set.
	layout.Inset
}

DetailRow lays out two widgets in a horizontal row, with the left widget considered the "Primary" widget.

func (DetailRow) Layout

func (d DetailRow) Layout(gtx layout.Context, primary, detail layout.Widget) layout.Dimensions

Layout the DetailRow with the provided widgets.

type Rounded

type Rounded unit.Dp

Rounded lays out a widget with rounded corners.

func (Rounded) Layout

func (r Rounded) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions

type VerticalMarginStyle

type VerticalMarginStyle struct {
	Size unit.Dp
}

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 (VerticalMarginStyle) Layout

Layout the provided widget within the margin and return their combined dimensions.

Jump to

Keyboard shortcuts

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