mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-15 08:29:29 +08:00
31 lines
598 B
Go
31 lines
598 B
Go
package menu
|
|
|
|
type MenuItem struct {
|
|
Id string `json:"Id,omitempty"`
|
|
Label string
|
|
Role Role `json:"Role,omitempty"`
|
|
Accelerator string `json:"Accelerator,omitempty"`
|
|
Type Type
|
|
Enabled bool
|
|
Visible bool
|
|
Checked bool
|
|
SubMenu []*MenuItem `json:"SubMenu,omitempty"`
|
|
}
|
|
|
|
func Text(label string, id string) *MenuItem {
|
|
return &MenuItem{
|
|
Id: id,
|
|
Label: label,
|
|
Type: NormalType,
|
|
Enabled: true,
|
|
Visible: true,
|
|
}
|
|
}
|
|
|
|
// Separator provides a menu separator
|
|
func Separator() *MenuItem {
|
|
return &MenuItem{
|
|
Type: SeparatorType,
|
|
}
|
|
}
|