Fixed and refactored context menu support

This commit is contained in:
Lea Anthony
2021-01-13 22:51:44 +11:00
parent de06fc7dcc
commit e65118e962
21 changed files with 223 additions and 325 deletions

View File

@@ -72,20 +72,20 @@ func (a *Application) processPlatformSettings() error {
}
if trays != nil {
for _, tray := range trays {
println("Adding tray menu: " + tray)
C.AddTrayMenu(a.app, a.string2CString(tray))
}
}
// Process context menus
//contextMenus := options.GetContextMenus(a.config)
//if contextMenus != nil {
// contextMenusJSON, err := processContextMenus(contextMenus)
// if err != nil {
// return err
// }
// C.SetContextMenus(a.app, a.string2CString(contextMenusJSON))
//}
contextMenus, err := a.menuManager.GetContextMenus()
if err != nil {
return err
}
if contextMenus != nil {
for _, contextMenu := range contextMenus {
C.AddContextMenu(a.app, a.string2CString(contextMenu))
}
}
return nil
}