apptheme

package
v0.0.0-...-4b42cdd Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT, Unlicense Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Primary        = rgb(0x69f0ae)
	PrimaryLight   = rgb(0x9fffe0)
	PrimaryDark    = rgb(0x2bbd7e)
	Secondary      = rgb(0xff80ab)
	SecondaryLight = rgb(0xffb2dd)
	SecondaryDark  = rgb(0xe94f7c)
	Black          = rgb(0x000000)
	White          = rgb(0xffffff)
	LightGray      = rgb(0xeeeeee)
	Gray           = rgb(0xdddddd)
	DarkGray       = rgb(0xcccccc)
	Background     = rgb(0xeeeeee)
)

Functions

This section is empty.

Types

type BoxStyle

type BoxStyle struct {
	Padding     layout.Inset
	Margin      layout.Inset
	Bg          color.NRGBA
	Rounding    unit.Dp
	BorderWidth unit.Dp
	BorderColor color.NRGBA
}

BoxStyle implements a simple box model layout primitive.

func Box

func Box(th *Theme) BoxStyle

Box constructs a default box.

func BoxFor

func BoxFor(th *material.Theme, surface ContrastPair) BoxStyle

BoxContrast constructs a box designed to contrast with the normal box.

func (BoxStyle) Layout

func (b BoxStyle) Layout(gtx C, w layout.Widget) D

Layout the box.

type C

type C = layout.Context

type ContrastPair

type ContrastPair struct {
	Base     color.NRGBA
	Contrast color.NRGBA
}

type D

type D = layout.Dimensions

type EditorStyle

type EditorStyle struct {
	Box         BoxStyle
	EditorStyle material.EditorStyle
}

EditorStyle configures the presentation of an editor.

func Editor

func Editor(th *Theme, state *widget.Editor, hint string) EditorStyle

TagEditor configures a default EditorStyle.

func (EditorStyle) Layout

func (s EditorStyle) Layout(gtx C) D

Layout the editor.

type Palette

type Palette struct {
	Primary      ContrastPair
	PrimaryLight ContrastPair
	Background   ContrastPair
	Surface1     ContrastPair
	Surface2     ContrastPair
	Surface3     ContrastPair
	Danger       ContrastPair
}

type SuggestorStyle

type SuggestorStyle[T comparable] struct {
	State             *appwidget.Suggestor[T]
	Surface           component.SurfaceStyle
	List              material.ListStyle
	OptionFunc        func(C, *Theme, T) D
	CreateOption      material.LabelStyle
	OptionPadding     layout.Inset
	SelectedHighlight color.NRGBA
	// contains filtered or unexported fields
}

SuggestorStyle presents completion suggestions.

func Suggestor

func Suggestor[T comparable](th *Theme, state *appwidget.Suggestor[T], optionFunc func(gtx C, th *Theme, option T) D) SuggestorStyle[T]

Suggestor configures a default SuggestorStyle.

func (SuggestorStyle[T]) Layout

func (s SuggestorStyle[T]) Layout(gtx C) D

Layout the suggestor.

type Theme

type Theme struct {
	Th *material.Theme
	Palette
}

func NewTheme

func NewTheme(fonts []text.FontFace) *Theme

type TxEditorStyle

type TxEditorStyle struct {
	Box         BoxStyle
	EditorStyle material.EditorStyle
	State       *appwidget.TxEditor
	SuggestorStyle[string]
	// contains filtered or unexported fields
}

TxEditorStyle configures the presentation of an editor that can suggest completions.

func TxEditor

func TxEditor(th *Theme, state *appwidget.TxEditor, hint string) TxEditorStyle

TagEditor configures a default TxEditorStyle.

func (TxEditorStyle) Layout

func (s TxEditorStyle) Layout(gtx C) D

Layout the editor and (possibly) the selection box.

type TxFormStyle

type TxFormStyle struct {
	State *appwidget.TxForm

	SubmitBtn material.ButtonStyle
	// contains filtered or unexported fields
}

func TxForm

func TxForm(th *Theme, state *appwidget.TxForm) TxFormStyle

func (TxFormStyle) Layout

func (t TxFormStyle) Layout(gtx C) D

type TxHeaderStyle

type TxHeaderStyle struct {
	Date    EditorStyle
	Payee   TxEditorStyle
	Message material.LabelStyle
}
func Header(th *Theme, date *widget.Editor, payee *appwidget.TxEditor, msg string) TxHeaderStyle

func (TxHeaderStyle) Layout

func (t TxHeaderStyle) Layout(gtx C) D

type TxRowStyle

type TxRowStyle struct {
	Amount  EditorStyle
	Account TxEditorStyle
	Message material.LabelStyle
}

func Row

func Row(th *Theme, state *appwidget.TxRow) TxRowStyle

func (TxRowStyle) Layout

func (t TxRowStyle) Layout(gtx C) D

Jump to

Keyboard shortcuts

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