Support Hidden/Disabled. Normal->Text

This commit is contained in:
Lea Anthony
2020-11-24 20:12:10 +11:00
parent 6f218264ed
commit 4fd3516f41
4 changed files with 74 additions and 59 deletions

View File

@@ -6,19 +6,17 @@ type MenuItem struct {
Role Role `json:"Role,omitempty"`
Accelerator string `json:"Accelerator,omitempty"`
Type Type
Enabled bool
Visible bool
Disabled bool
Hidden 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,
Id: id,
Label: label,
Type: TextType,
}
}

View File

@@ -4,8 +4,8 @@ package menu
type Type string
const (
// NormalType is the Normal menuitem type
NormalType Type = "Normal"
// TextType is the text menuitem type
TextType Type = "Text"
// SeparatorType is the Separator menuitem type
SeparatorType Type = "Separator"
// SubmenuType is the Submenu menuitem type