uikit

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package uikit holds the desktop app's generic UI pieces that frostui does not have yet: tab strips, a split tree of tab groups and a side panel's icon pane tabs (plan 0009). It imports only the standard library, MyGo, purego and frostui, which a test enforces, so that a piece moves into frostui by changing its import path.

Index

Constants

View Source
const (
	EdgeLeft   = "left"
	EdgeRight  = "right"
	EdgeTop    = "top"
	EdgeBottom = "bottom"
)

The edges of a group, where a dropped tab makes a new split.

Variables

This section is empty.

Functions

func DropEdges

func DropEdges(c *ui.Context, drop func(id, edge string))

DropEdges draws, over a group's view while a tab is dragged, the four edges it can land on to make a new split, and a center that joins the group.

func PaneTabs

func PaneTabs(c *ui.Context, label string, panes []PaneTab, active int, choose func(id string)) ui.Element

PaneTabs is a row of icon tabs choosing a side panel's pane.

func SelectedRow added in v0.6.0

func SelectedRow(e ui.Element, t *ui.Theme) ui.Element

SelectedRow draws e as frostui's selected row (ADR-0011 of frostui): the selected fill, a 1px accent rule on its leading edge, and the selected text.

func SplitView

func SplitView(c *ui.Context, n *SplitNode, state *SplitState, resize func(id string, sizes []float64))

SplitView draws a split tree; resize reports a split's new sizes.

func ToolButton

func ToolButton(c *ui.Context, icon, label string) ui.Element

ToolButton is a flat icon button for the dense rows of a pane or a tab strip: frostui's IconButton keeps the padding of a form's.

Types

type PaneTab

type PaneTab struct {
	ID, Title, Icon string
}

PaneTab is a pane in a side panel's tabs.

type SplitNode

type SplitNode struct {
	ID       string
	Row      bool
	Children []*SplitNode
	Sizes    []float64
	Leaf     func(c *ui.Context)
}

SplitNode is a node of a split tree: a leaf draws itself; a split lays out at least two children side by side (Row) or stacked, with sizes that sum to 1.

type SplitState

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

SplitState keeps each divider's position while it is dragged.

type Tab

type Tab struct {
	ID, Title string
	Pinned    bool
}

Tab is a tab of a strip.

type TabDrag

type TabDrag struct{ ID string }

TabDrag is the value a dragged tab carries.

type TabStrip

type TabStrip struct {
	Label string
	// NewLabel and ListLabel name the New and List buttons, and CloseLabel a
	// tab's close button, given its title.
	NewLabel, ListLabel string
	CloseLabel          func(title string) string
	Tabs                []Tab
	Active              int
	// Activate chooses a tab, Close closes one, New adds one.
	Activate func(id string)
	Close    func(id string)
	New      func()
	// Move puts a dragged tab at index of this strip.
	Move func(id string, index int)
	// Menu builds a tab's context menu; List the menu of all the tabs.
	Menu func(m *ui.Menu, id string)
	List func(m *ui.Menu)
	// Dragging is set while a tab of the strip is dragged, so the groups
	// show where it can land.
	Dragging *bool
	// Revealed is the tab last scrolled into view, so that a new active tab
	// is, and the user can then scroll away from it.
	Revealed *string
}

TabStrip is a row of closable, pinnable, draggable tabs over a group's view: Up and the arrows are its own, a middle click closes a tab, and the context menu key or a right click opens its menu.

func (TabStrip) View

func (s TabStrip) View(c *ui.Context) ui.Element

View draws the strip.

Jump to

Keyboard shortcuts

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