mirror of
https://github.com/Fabio286/antares.git
synced 2025-02-17 04:00:48 +01:00
feat: added macos basic shortcusts and menu
This commit is contained in:
parent
a35566f273
commit
430490ad93
@ -118,7 +118,25 @@ function createAppMenu () {
|
||||
if (isMacOS) {
|
||||
menu = Menu.buildFromTemplate([
|
||||
{
|
||||
role: 'appMenu'
|
||||
label: app.name,
|
||||
submenu: [
|
||||
{ role: 'about' },
|
||||
{ type: 'separator' },
|
||||
{
|
||||
label: 'Check for Updates...',
|
||||
click: (_menuItem, win) => win.webContents.send('open-updates-preferences')
|
||||
},
|
||||
{
|
||||
label: 'Preferences',
|
||||
click: (_menuItem, win) => win.webContents.send('toggle-preferences'),
|
||||
accelerator: 'CmdOrCtrl+,'
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{ role: 'hide' },
|
||||
{ role: 'hideOthers' },
|
||||
{ type: 'separator' },
|
||||
{ role: 'quit' }
|
||||
]
|
||||
},
|
||||
{
|
||||
role: 'editMenu'
|
||||
|
@ -13,6 +13,7 @@ import notifications from './modules/notifications.store';
|
||||
|
||||
import ipcUpdates from './plugins/ipcUpdates';
|
||||
import ipcExceptions from './plugins/ipcExceptions';
|
||||
import ipcShortcuts from './plugins/ipcShortcuts';
|
||||
|
||||
Vue.use(Vuex);
|
||||
|
||||
@ -29,6 +30,7 @@ export default new Vuex.Store({
|
||||
},
|
||||
plugins: [
|
||||
ipcUpdates,
|
||||
ipcExceptions
|
||||
ipcExceptions,
|
||||
ipcShortcuts
|
||||
]
|
||||
});
|
||||
|
12
src/renderer/store/plugins/ipcShortcuts.js
Normal file
12
src/renderer/store/plugins/ipcShortcuts.js
Normal file
@ -0,0 +1,12 @@
|
||||
import { ipcRenderer } from 'electron';
|
||||
|
||||
export default store => {
|
||||
ipcRenderer.on('toggle-preferences', (event, error) => {
|
||||
store.dispatch('application/showSettingModal', 'general');
|
||||
});
|
||||
|
||||
ipcRenderer.on('open-updates-preferences', (event, error) => {
|
||||
store.dispatch('application/showSettingModal', 'update');
|
||||
ipcRenderer.send('check-for-updates');
|
||||
});
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user