Documentation ¶
Index ¶
- type ContextMenu
- type Manager
- func (m *Manager) AddContextMenu(contextMenu *menu.ContextMenu)
- func (m *Manager) AddTrayMenu(trayMenu *menu.TrayMenu) (string, error)
- func (m *Manager) GetApplicationMenuJSON() string
- func (m *Manager) GetContextMenus() ([]string, error)
- func (m *Manager) GetTrayID(trayMenu *menu.TrayMenu) (string, error)
- func (m *Manager) GetTrayMenus() ([]string, error)
- func (m *Manager) OnTrayMenuClose(id string)
- func (m *Manager) OnTrayMenuOpen(id string)
- func (m *Manager) ProcessClick(menuID string, data string, menuType string, parentID string) error
- func (m *Manager) SetApplicationMenu(applicationMenu *menu.Menu) error
- func (m *Manager) SetTrayMenu(trayMenu *menu.TrayMenu) (string, error)
- func (m *Manager) UpdateApplicationMenu() (string, error)
- func (m *Manager) UpdateContextMenu(contextMenu *menu.ContextMenu) (string, error)
- func (m *Manager) UpdateTrayMenuLabel(trayMenu *menu.TrayMenu) (string, error)
- type MenuItemMap
- type ProcessedMenu
- type ProcessedMenuItem
- type RadioGroup
- type TrayMenu
- type WailsMenu
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextMenu ¶
type ContextMenu struct { ID string ProcessedMenu *WailsMenu // contains filtered or unexported fields }
func NewContextMenu ¶
func NewContextMenu(contextMenu *menu.ContextMenu) *ContextMenu
func (*ContextMenu) AsJSON ¶
func (t *ContextMenu) AsJSON() (string, error)
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager() *Manager
func (*Manager) AddContextMenu ¶
func (m *Manager) AddContextMenu(contextMenu *menu.ContextMenu)
func (*Manager) AddTrayMenu ¶
func (*Manager) GetApplicationMenuJSON ¶
func (*Manager) GetContextMenus ¶
func (*Manager) GetTrayMenus ¶
func (*Manager) OnTrayMenuClose ¶
func (*Manager) OnTrayMenuOpen ¶
func (*Manager) ProcessClick ¶
func (*Manager) SetApplicationMenu ¶
func (*Manager) SetTrayMenu ¶
SetTrayMenu updates or creates a menu
func (*Manager) UpdateApplicationMenu ¶
UpdateApplicationMenu reprocesses the application menu to pick up structure changes etc Returns the JSON representation of the updated menu
func (*Manager) UpdateContextMenu ¶
func (m *Manager) UpdateContextMenu(contextMenu *menu.ContextMenu) (string, error)
type MenuItemMap ¶
type MenuItemMap struct {
// contains filtered or unexported fields
}
MenuItemMap holds a mapping between menuIDs and menu items
func NewMenuItemMap ¶
func NewMenuItemMap() *MenuItemMap
func (*MenuItemMap) AddMenu ¶
func (m *MenuItemMap) AddMenu(menu *menu.Menu)
func (*MenuItemMap) Dump ¶
func (m *MenuItemMap) Dump()
type ProcessedMenu ¶
type ProcessedMenu struct {
Items []*ProcessedMenuItem
}
func NewProcessedMenu ¶
func NewProcessedMenu(menuItemMap *MenuItemMap, menu *menu.Menu) *ProcessedMenu
type ProcessedMenuItem ¶
type ProcessedMenuItem struct { ID string // Label is what appears as the menu text Label string `json:",omitempty"` // Role is a predefined menu type Role menu.Role `json:",omitempty"` // Accelerator holds a representation of a key binding Accelerator *keys.Accelerator `json:",omitempty"` // Type of MenuItem, EG: Checkbox, Text, Separator, Radio, Submenu Type menu.Type // Disabled makes the item unselectable Disabled bool `json:",omitempty"` // Hidden ensures that the item is not shown in the menu Hidden bool `json:",omitempty"` // Checked indicates if the item is selected (used by Checkbox and Radio types only) Checked bool `json:",omitempty"` // Submenu contains a list of menu items that will be shown as a submenu //SubMenu []*MenuItem `json:"SubMenu,omitempty"` SubMenu *ProcessedMenu `json:",omitempty"` // Colour RGBA string `json:",omitempty"` // Font FontSize int `json:",omitempty"` FontName string `json:",omitempty"` // Image - base64 image data Image string `json:",omitempty"` MacTemplateImage bool `json:", omitempty"` MacAlternate bool `json:", omitempty"` // Tooltip Tooltip string `json:",omitempty"` // Styled label StyledLabel []*ansi.StyledText `json:",omitempty"` }
func NewProcessedMenuItem ¶
func NewProcessedMenuItem(menuItemMap *MenuItemMap, menuItem *menu.MenuItem) *ProcessedMenuItem
type RadioGroup ¶
RadioGroup holds all the members of the same radio group
type TrayMenu ¶
type TrayMenu struct { ID string Label string FontSize int FontName string Disabled bool Tooltip string `json:",omitempty"` Image string MacTemplateImage bool RGBA string ProcessedMenu *WailsMenu StyledLabel []*ansi.StyledText `json:",omitempty"` // contains filtered or unexported fields }
func NewTrayMenu ¶
type WailsMenu ¶
type WailsMenu struct { Menu *ProcessedMenu RadioGroups []*RadioGroup // contains filtered or unexported fields }
WailsMenu is the original menu with the addition of radio groups extracted from the menu data
func NewWailsMenu ¶
func NewWailsMenu(menuItemMap *MenuItemMap, menu *menu.Menu) *WailsMenu
Click to show internal directories.
Click to hide internal directories.