-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
menu_bar_darwin.go
36 lines (31 loc) · 1.36 KB
/
menu_bar_darwin.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2021-2024 by Richard A. Wilkes. All rights reserved.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, version 2.0. If a copy of the MPL was not distributed with
// this file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// This Source Code Form is "Incompatible With Secondary Licenses", as
// defined by the Mozilla Public License, version 2.0.
package unison
import (
"fmt"
"github.com/richardwilkes/toolbox/cmdline"
"github.com/richardwilkes/toolbox/i18n"
"github.com/richardwilkes/unison/internal/ns"
)
func quitMenuTitle() string {
return i18n.Text("Quit")
}
func platformAddAppMenuEntries(m Menu) {
m.InsertSeparator(-1, true)
m.InsertMenu(-1, m.Factory().NewMenu(ServicesMenuID, i18n.Text("Services"), nil))
m.InsertSeparator(-1, false)
m.InsertItem(-1, m.Factory().NewItem(HideItemID, fmt.Sprintf(i18n.Text("Hide %s"), cmdline.AppName),
KeyBinding{KeyCode: KeyH, Modifiers: OSMenuCmdModifier()},
nil, func(MenuItem) { ns.HideApplication() }))
m.InsertItem(-1, m.Factory().NewItem(HideOthersItemID, i18n.Text("Hide Others"),
KeyBinding{KeyCode: KeyH, Modifiers: OptionModifier | OSMenuCmdModifier()},
nil, func(MenuItem) { ns.HideOtherApplications() }))
m.InsertItem(-1, m.Factory().NewItem(ShowAllItemID, i18n.Text("Show All"), KeyBinding{}, nil,
func(MenuItem) { ns.UnhideAllApplications() }))
}