configui

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package configui derives a guigui settings UI from a plain Go struct.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomGroup

type CustomGroup interface {
	NewConfigWidget() CustomWidget
}

type CustomWidget

type CustomWidget interface {
	guigui.Widget
	Bind(v any)
}

type Editor

type Editor[T any] struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

Editor is a modal settings overlay for a configuration struct T. Open it from a menu (or anywhere else) with Editor.SetOpen. Editing a field in the UI mutates *target directly through reflection.

func (*Editor[T]) Build

func (e *Editor[T]) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*Editor[T]) IsOpen

func (e *Editor[T]) IsOpen() bool

func (*Editor[T]) Layout

func (e *Editor[T]) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*Editor[T]) OnClose

func (e *Editor[T]) OnClose(f func(context *guigui.Context, reason basicwidget.PopupCloseReason))

func (*Editor[T]) SetOpen

func (e *Editor[T]) SetOpen(open bool)

func (*Editor[T]) SetTarget

func (e *Editor[T]) SetTarget(v *T)

type Enum

type Enum interface {
	EnumOptions() []EnumOption
}

type EnumOption

type EnumOption struct {
	Value string // Value is the underlying value stored on the struct field.
	Label string // Label is the string presented in the UI.
}

type MapTable

type MapTable struct {
	guigui.DefaultWidget
	// contains filtered or unexported fields
}

func (*MapTable) Build

func (t *MapTable) Build(context *guigui.Context, adder *guigui.ChildAdder) error

func (*MapTable) ClearSelection

func (t *MapTable) ClearSelection()

ClearSelection drops the highlighted row. The table reports a click only when the selection changes, so a row left selected cannot be chosen again.

func (*MapTable) Layout

func (t *MapTable) Layout(context *guigui.Context, widgetBounds *guigui.WidgetBounds, layouter *guigui.ChildLayouter)

func (*MapTable) Measure

func (t *MapTable) Measure(context *guigui.Context, constraints guigui.Constraints) image.Point

func (*MapTable) OnRowSelected

func (t *MapTable) OnRowSelected(f func(id string))

func (*MapTable) SetHeaders

func (t *MapTable) SetHeaders(buttonHeader, inputHeader string)

func (*MapTable) SetRows

func (t *MapTable) SetRows(rows []MapTableRow)

type MapTableRow

type MapTableRow struct {
	ID, Label, Value string
}

type PadConfig

type PadConfig interface {
	Normalize()
	Attached(port int) bool
	SetAttached(port int, v bool)
	Preset(port int) int
	SetPreset(port int, n int)
	BindingLabel(preset int, button string) string
	SetBinding(preset int, button, key string, gamepad int, padButton string)
}

Jump to

Keyboard shortcuts

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