menu

package
v0.0.0-...-ad944e5 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewModule

func NewModule(mctx barbara.ModuleContext) (barbara.Module, error)

NewModule returns a new Module instance.

Types

type Config

type Config struct {
	// Label is the text used on the menu button.
	Label string `json:"label"`
	// Items is a slice of menu items.
	Items []ItemConfig `json:"items"`
}

Config holds all menu module configuration.

type ItemConfig

type ItemConfig struct {
	// Separator is true if this item is a separator.
	Separator bool `json:"separator,omitempty"`
	// Label is the text used for this menu item.
	Label string `json:"label,omitempty"`
	// Icon is an icon name.
	// TODO(elliot): Document further once I know more about how this is going to work.
	Icon string `json:"icon,omitempty"`
	// Exec specifies the command to execute when this menu item is activated.
	Exec string `json:"exec,omitempty"`
}

ItemConfig holds configuration for a single menu item.

type Module

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

Module is a Barbara Module that presents a menu. Menus contain menu items that are able to be clicked. You can also include separators.

func (*Module) Destroy

func (m *Module) Destroy() error

Destroy frees up resources. There are no background processes in a menu module.

func (*Module) Render

func (m *Module) Render() (widgets.QLayout_ITF, error)

Render attempts to return a button widget that will open a menu containing some pre-configured menu items, ready to be placed onto a bar.

Jump to

Keyboard shortcuts

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