util

package
v0.0.0-...-ad861b7 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MIT, Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ButtonOption

type ButtonOption func(*ButtonStyle)

func WithBgColor

func WithBgColor(c color.NRGBA) ButtonOption

func WithIcon

func WithIcon(icon *widget.Icon) ButtonOption

func WithIconColor

func WithIconColor(c color.NRGBA) ButtonOption

func WithInset

func WithInset(inset layout.Inset) ButtonOption

func WithSize

func WithSize(sz unit.Value) ButtonOption

type ButtonStyle

type ButtonStyle struct {
	material.IconButtonStyle
	material.ButtonStyle
}

ButtonStyle provides a unified api for both icon buttons and text buttons.

func Button

func Button(
	state *widget.Clickable,
	opt ...ButtonOption,
) ButtonStyle

Button renders a clickable button.

func (ButtonStyle) Layout

func (btn ButtonStyle) Layout(gtx C) D

type C

type C = layout.Context

type D

type D = layout.Dimensions

type Div

type Div struct {
	Thickness unit.Value
	Length    unit.Value
	Axis      layout.Axis
	Color     color.NRGBA
}

Div is a visual divider: a colored line with a thickness.

func (Div) Layout

func (d Div) Layout(gtx C) D

type Rect

type Rect struct {
	Color color.NRGBA
	Size  f32.Point
	Radii float32
}

Rect creates a rectangle of the provided background color with Dimensions specified by size and a corner radius (on all corners) specified by radii.

func (Rect) Layout

func (r Rect) Layout(gtx C) D

Layout renders the Rect into the provided context

Jump to

Keyboard shortcuts

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