Refactor TrayOptions to Tray. Add ID.

This commit is contained in:
Lea Anthony
2021-01-04 15:58:28 +11:00
parent a09e9d4586
commit a55fc4d0e9
8 changed files with 29 additions and 15 deletions

View File

@@ -1,7 +1,11 @@
package menu
// TrayOptions are the options
type TrayOptions struct {
// Tray are the options
type Tray struct {
// The ID of this tray
ID string
// Label is the text we wish to display in the tray
Label string

View File

@@ -9,6 +9,6 @@ type Options struct {
WebviewIsTransparent bool
WindowBackgroundIsTranslucent bool
Menu *menu.Menu
Tray *menu.TrayOptions
Tray *menu.Tray
ContextMenus *menu.ContextMenus
}

View File

@@ -25,7 +25,7 @@ type App struct {
DevTools bool
RGBA int
ContextMenus *menu.ContextMenus
Tray *menu.TrayOptions
Tray *menu.Tray
Menu *menu.Menu
Mac *mac.Options
Logger logger.Logger `json:"-"`
@@ -41,8 +41,8 @@ func MergeDefaults(appoptions *App) {
}
func GetTray(appoptions *App) *menu.TrayOptions {
var result *menu.TrayOptions
func GetTray(appoptions *App) *menu.Tray {
var result *menu.Tray
switch runtime.GOOS {
case "darwin":
if appoptions.Mac != nil {