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
- func DropEdges(c *ui.Context, drop func(id, edge string))
- func PaneTabs(c *ui.Context, label string, panes []PaneTab, active int, ...) ui.Element
- func SelectedRow(e ui.Element, t *ui.Theme) ui.Element
- func SplitView(c *ui.Context, n *SplitNode, state *SplitState, ...)
- func ToolButton(c *ui.Context, icon, label string) ui.Element
- type PaneTab
- type SplitNode
- type SplitState
- type Tab
- type TabDrag
- type TabStrip
Constants ¶
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 ¶
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
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.
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 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.