Documentation ¶
Overview ¶
Package collapsing provides a group that supports expanding/collapsing, and a controller to allow programmatic expansion/collapse.
When collapsed (default state), only a button to expand is visible. When expanded, all module outputs are shown, and buttons to collapse.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultButtons ¶
func DefaultButtons(c Controller) (start, end bar.Output)
DefaultButtons returns the default button outputs: - When expanded, a '>' and '<' on either side. - When collapsed, a single '+'.
Types ¶
type ButtonFunc ¶
type ButtonFunc func(Controller) (start, end bar.Output)
ButtonFunc produces outputs for buttons in a collapsing group.
type Controller ¶
type Controller interface { // Expanded returns true if the group is expanded (showing output). Expanded() bool // Collapse collapses the group and hides all modules. Collapse() // Expand expands the group and shows all modules. Expand() // Toggle toggles the visibility of all modules. Toggle() // ButtonFunc controls the output for the button(s). ButtonFunc(ButtonFunc) }
Controller provides an interface to control a collapsing group.
Click to show internal directories.
Click to hide internal directories.