ui

package
v0.0.0-...-a709619 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const PageSize = 30 // puzzles on one page

Variables

View Source
var (
	BlackColor  = color.NRGBA{R: 0x00, G: 0x00, B: 0x00, A: 0xFF}
	WhiteColor  = color.NRGBA{R: 0xFF, G: 0xFF, B: 0xFF, A: 0xFF}
	GrayColor   = color.NRGBA{R: 0x80, G: 0x80, B: 0x80, A: 0xFF}
	RedColor    = color.NRGBA{R: 0xB8, G: 0x40, B: 0x40, A: 0xFF}
	YellowColor = color.NRGBA{R: 0xB8, G: 0xB8, B: 0x40, A: 0xFF}
	GreenColor  = color.NRGBA{R: 0x40, G: 0xB8, B: 0x40, A: 0xFF}
	BlueColor   = color.NRGBA{R: 0x40, G: 0x40, B: 0xB8, A: 0xFF}
)

Functions

func Disabled

func Disabled(c color.NRGBA) (d color.NRGBA)

Disabled blends color towards the luminance and multiplies alpha. Blending towards luminance will desaturate the color. Multiplying alpha blends the color together more with the background.

func MulAlpha

func MulAlpha(c color.NRGBA, alpha uint8) color.NRGBA

MulAlpha applies the alpha to the color.

func Pad

func Pad(padding unit.Dp, widget layout.Widget) layout.Widget

func PadSides

func PadSides(padding unit.Dp, widget layout.Widget) layout.Widget

func Transparentize

func Transparentize(c color.NRGBA, percent float32) color.NRGBA

Types

type BoardControls

type BoardControls struct {
	// contains filtered or unexported fields
}

func NewBoardControls

func NewBoardControls(th *material.Theme) *BoardControls

func (*BoardControls) Layout

func (c *BoardControls) Layout(gtx layout.Context) layout.Dimensions

func (*BoardControls) ShouldFlip

func (c *BoardControls) ShouldFlip(gtx layout.Context) bool

func (*BoardControls) ShouldMoveBackward

func (c *BoardControls) ShouldMoveBackward(gtx layout.Context) bool

func (*BoardControls) ShouldMoveForward

func (c *BoardControls) ShouldMoveForward(gtx layout.Context) bool

func (*BoardControls) ShouldReset

func (c *BoardControls) ShouldReset(gtx layout.Context) bool

type Icon

type Icon []byte
var (
	ResetIcon    Icon = icons.NavigationRefresh
	FlipIcon     Icon = icons.NotificationSync
	BackwardIcon Icon = icons.NavigationArrowBack
	ForwardIcon  Icon = icons.NavigationArrowForward
	SearchIcon   Icon = icons.ActionSearch
)

type IconButton

type IconButton struct {
	// contains filtered or unexported fields
}

func NewIconButton

func NewIconButton(th *material.Theme, name Icon, color color.NRGBA) *IconButton

func (*IconButton) Layout

func (b *IconButton) Layout(gtx layout.Context) layout.Dimensions

type OpeningName

type OpeningName struct {
	// contains filtered or unexported fields
}

func NewOpeningName

func NewOpeningName(th *material.Theme) *OpeningName

func (*OpeningName) Layout

func (w *OpeningName) Layout(gtx layout.Context) layout.Dimensions

func (*OpeningName) Set

func (w *OpeningName) Set(name core.OpeningName)

type OptionSelector

type OptionSelector[Option fmt.Stringer] struct {
	// contains filtered or unexported fields
}

func NewOptionSelector

func NewOptionSelector[Option fmt.Stringer](th *material.Theme, options []Option) *OptionSelector[Option]

func (*OptionSelector[Option]) Layout

func (w *OptionSelector[Option]) Layout(gtx layout.Context) layout.Dimensions

func (*OptionSelector[Option]) Selected

func (w *OptionSelector[Option]) Selected() (o Option)

type RangeSlider

type RangeSlider struct {
	// contains filtered or unexported fields
}

func NewRangeSlider

func NewRangeSlider(th *material.Theme, hint string, min, max uint8) *RangeSlider

func (*RangeSlider) Layout

func (s *RangeSlider) Layout(gtx layout.Context) layout.Dimensions

func (*RangeSlider) Selected

func (s *RangeSlider) Selected() (res uint8)

func (*RangeSlider) Set

func (s *RangeSlider) Set(value uint8)

type TextField

type TextField struct {
	// contains filtered or unexported fields
}

func NewTextField

func NewTextField(th *material.Theme, hint string, options TextFieldOption) *TextField

func (*TextField) Layout

func (w *TextField) Layout(gtx layout.Context) layout.Dimensions

func (*TextField) SetText

func (w *TextField) SetText(text string)

type TextFieldOption

type TextFieldOption int8
const (
	ReadOnly TextFieldOption = 1 << iota
	SingleLine
)

type Window

type Window struct {
	// contains filtered or unexported fields
}

func NewWindow

func NewWindow() (*Window, error)

func (*Window) Show

func (w *Window) Show(ctx context.Context)

Jump to

Keyboard shortcuts

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