Documentation
¶
Overview ¶
SPDX-License-Identifier: Unlicense OR MIT
SPDX-License-Identifier: Unlicense OR MIT
Index ¶
- func Alpha(a float64, col color.RGBA) color.RGBA
- func DuoUIdrawRectangle(gtx *layout.Context, w, h int, color string, borderRadius [4]float32, ...)
- func DuoUIinputField(duo *models.DuoUI, cx *conte.Xt, fieldName, fieldModel string, ...)
- func Format(gtx *layout.Context, format string, widgets ...layout.Widget)
- func FormatAmount(a float64) string
- func FormatTime(t time.Time) string
- func RGB(c uint32) color.RGBA
- type Field
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DuoUIdrawRectangle ¶
func DuoUIinputField ¶
func FormatAmount ¶
func FormatTime ¶
func RGB ¶
Format lays out widgets according to a format string, similar to how fmt.Printf interpolates a string.
The format string is an epxression where layouts are similar to function calls, and the underscore denotes a widget from the arguments. The ith _ invokes the ith widget from the arguments.
If the layout format is invalid, Format panics with an error where a cross, ✗, marks the error position.
For example,
Format(gtx, "inset(8dp, _)", w)
is equivalent to
layout.UniformInset(unit.Dp(8)).Layout(gtx, w)
Available layouts:
inset(insets, widget) applies inset to widget. Insets are either: one value for uniform insets; two values for top/bottom and right/left insets; three values for top, bottom and right/left insets; or four values for top, right, bottom, left insets.
direction(widget) aligns a widget. Direction is one of north, northeast, east, southeast, south, southwest, west, northwest, center.
hmax/vmax/max(widget) forces the horizontal, vertical or both constraints to their maximum before laying out widget.
hmin/vmin/min(widget) forces the horizontal, vertical or both constraints to their minimum before laying out widget.
hcap/vcap(size, widget) caps the maximum horizontal or vertical constraints to size.
hflex/vflex(alignment, children...) lays out children with a horizontal or vertical layout.Flex. Each rigid child must be on the form r(widget), and each flex child on the form f(<weight>, widget). If alignment is specified, it must be one of: start, middle, end, baseline. The default alignment is start.
stack(alignment, children) lays out children with a layout.Stack. Each Rigid child must be on the form r(widget), and each expand child on the form e(widget). If alignment is specified it must be one of the directions listed above.