Index | Files

package collapsing

import ""

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.


Package Files


func DefaultButtons Uses

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 '+'.

type ButtonFunc Uses

type ButtonFunc func(Controller) (start, end bar.Output)

ButtonFunc produces outputs for buttons in a collapsing group.

type Controller Uses

type Controller interface {
    // Expanded returns true if the group is expanded (showing output).
    Expanded() bool
    // Collapse collapses the group and hides all modules.
    // Expand expands the group and shows all modules.
    // Toggle toggles the visibility of all modules.
    // ButtonFunc controls the output for the button(s).

Controller provides an interface to control a collapsing group.

func Group Uses

func Group(m (bar.Module, Controller)

Group returns a new collapsing group, and a linked controller.

Package collapsing imports 8 packages (graph) and is imported by 1 packages. Updated 2018-11-25. Refresh now. Tools for package owners.