-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Fixing macOS tray #2936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing macOS tray #2936
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,7 @@ | |
| "electron-debug": "3.2.0", | ||
| "electron-dl": "3.3.1", | ||
| "electron-window-state": "5.0.3", | ||
| "escape-html": "^1.0.3", | ||
| "express": "4.18.1", | ||
| "express-partial-content": "1.0.2", | ||
| "express-rate-limit": "6.4.0", | ||
|
|
@@ -82,6 +83,7 @@ | |
| "turndown": "7.1.1", | ||
| "unescape": "1.0.1", | ||
| "ws": "8.8.0", | ||
| "xml2js": "^0.4.23", | ||
| "yauzl": "2.10.0" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are these extra dependencies added? |
||
| }, | ||
| "devDependencies": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,43 +51,47 @@ const registerVisibilityListener = () => { | |
| } | ||
|
|
||
| const updateTrayMenu = () => { | ||
| const mainWindow = windowService.getMainWindow(); | ||
| if (process.platform != 'darwin') { | ||
| // Menus under macos cause multiple changeVisibility triggers | ||
| const mainWindow = windowService.getMainWindow(); | ||
|
|
||
| const contextMenu = Menu.buildFromTemplate([ | ||
| { | ||
| label: isVisible ? 'Hide' : 'Show', | ||
| type: 'normal', | ||
| click: () => { | ||
| if (isVisible) { | ||
| mainWindow.hide(); | ||
| } else { | ||
| mainWindow.show(); | ||
| const contextMenu = Menu.buildFromTemplate([ | ||
| { | ||
| label: isVisible ? 'Hide' : 'Show', | ||
| type: 'normal', | ||
| click: () => { | ||
| if (isVisible) { | ||
| mainWindow.hide(); | ||
| } else { | ||
| mainWindow.show(); | ||
| mainWindow.focus(); | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| type: 'separator' | ||
| }, | ||
| { | ||
| label: 'Quit', | ||
| type: 'normal', | ||
| click: () => { | ||
| mainWindow.close(); | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| type: 'separator' | ||
| }, | ||
| { | ||
| label: 'Quit', | ||
| type: 'normal', | ||
| click: () => { | ||
| mainWindow.close(); | ||
| } | ||
| }, | ||
| ]); | ||
| }, | ||
| ]); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There seem to be many whitespace changes which are unnecessary and obscure the real change.. |
||
|
|
||
| tray?.setContextMenu(contextMenu); | ||
| tray?.setContextMenu(contextMenu); | ||
| } | ||
| } | ||
| const changeVisibility = () => { | ||
| const window = windowService.getMainWindow(); | ||
|
|
||
| if (isVisible) { | ||
| window.hide(); | ||
| } else { | ||
| window.show(); | ||
| window.focus(); | ||
| } | ||
| if (isVisible) { | ||
| window.hide(); | ||
| } else { | ||
| window.show(); | ||
| window.focus(); | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indent seems to be wrong here. |
||
| } | ||
|
|
||
| function createTray() { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of these changes seem either irrelevant (*.log) or wrong (package.json, .gitignore).