forked from marktext/marktext
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindow.js
More file actions
executable file
·60 lines (58 loc) · 1.59 KB
/
window.js
File metadata and controls
executable file
·60 lines (58 loc) · 1.59 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { Menu } from 'electron'
import { minimizeWindow, toggleAlwaysOnTop, toggleFullScreen } from '../actions/window'
import { zoomIn, zoomOut } from '../../windows/utils'
import { isOsx } from '../../config'
export default function (keybindings) {
const menu = {
label: '&Window',
role: 'window',
submenu: [{
label: 'Minimize',
accelerator: keybindings.getAccelerator('window.minimize'),
click (menuItem, browserWindow) {
minimizeWindow(browserWindow)
}
}, {
id: 'alwaysOnTopMenuItem',
label: 'Always on Top',
type: 'checkbox',
accelerator: keybindings.getAccelerator('window.toggle-always-on-top'),
click (menuItem, browserWindow) {
toggleAlwaysOnTop(browserWindow)
}
}, {
type: 'separator'
}, {
label: 'Zoom In',
accelerator: keybindings.getAccelerator('window.zoom-in'),
click (menuItem, browserWindow) {
zoomIn(browserWindow)
}
}, {
label: 'Zoom Out',
accelerator: keybindings.getAccelerator('window.zoom-out'),
click (menuItem, browserWindow) {
zoomOut(browserWindow)
}
}, {
type: 'separator'
}, {
label: 'Show in Full Screen',
accelerator: keybindings.getAccelerator('window.toggle-full-screen'),
click (item, browserWindow) {
if (browserWindow) {
toggleFullScreen(browserWindow)
}
}
}]
}
if (isOsx) {
menu.submenu.push({
label: 'Bring All to Front',
click () {
Menu.sendActionToFirstResponder('arrangeInFront:')
}
})
}
return menu
}