Skip to content

Commit

Permalink
fix(mac-menu): missing default mac-menu
Browse files Browse the repository at this point in the history
  • Loading branch information
JPSchellenberg committed Apr 10, 2021
1 parent d6035e5 commit 961abbf
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 0 deletions.
6 changes: 6 additions & 0 deletions locales/lumi/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@
"consent_warning": "You need to at least consent to the privacy policy to use this application."
},
"menu": {
"mac": {
"services": "Services",
"hide": "Hide Lumi",
"hideothers": "Hide Others",
"unhide": "Show all"
},
"quit": "Quit",
"file": {
"label": "File",
Expand Down
2 changes: 2 additions & 0 deletions server/src/menu/analyticsMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import electron from 'electron';
import SocketIO from 'socket.io';
import i18next from 'i18next';

import macMenu from './macMenu';
import helpMenu from './helpMenu';
import editMenu from './editMenu';

export default (window: electron.BrowserWindow, websocket: SocketIO.Server) => [
...macMenu(),
{
label: i18next.t('lumi:menu.file.label'),
submenu: [
Expand Down
2 changes: 2 additions & 0 deletions server/src/menu/h5peditorMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import i18next from 'i18next';

import helpMenu from './helpMenu';
import editMenu from './editMenu';
import macMenu from './macMenu';

export default (window: electron.BrowserWindow, websocket: SocketIO.Server) => [
...macMenu(),
{
label: i18next.t('lumi:menu.file.label'),
submenu: [
Expand Down
2 changes: 2 additions & 0 deletions server/src/menu/launchpadMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import electron from 'electron';
import SocketIO from 'socket.io';
import editMenu from './editMenu';

import macMenu from './macMenu';
import helpMenu from './helpMenu';

export default (window: electron.BrowserWindow, websocket: SocketIO.Server) => [
...macMenu(),
editMenu(),
helpMenu(window, websocket)
];
38 changes: 38 additions & 0 deletions server/src/menu/macMenu.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import i18next from 'i18next';
const isMac = process.platform === 'darwin';

export default function (): any {
return isMac
? [
{
label: 'Lumi',
submenu: [
{
label: i18next.t('lumi:menu.help.about'),
role: 'about'
},
{ type: 'separator' },
{
label: i18next.t('lumi:menu.mac.services'),
role: 'services'
},
{ type: 'separator' },
{ label: i18next.t('lumi:menu.mac.hide'), role: 'hide' },
{
label: i18next.t('lumi:menu.mac.hideothers'),
role: 'hideothers'
},
{
label: i18next.t('lumi:menu.mac.unhide'),
role: 'unhide'
},
{ type: 'separator' },
{
label: i18next.t('lumi:menu.quit'),
role: 'quit'
} as any
]
}
]
: [];
}

0 comments on commit 961abbf

Please sign in to comment.