mirror of
https://github.com/Fabio286/antares.git
synced 2025-03-15 10:50:04 +01:00
Merge pull request #126 from toriphes/master
feat: added macos basic shortcusts and menu
This commit is contained in:
commit
cd1ebacf89
@ -126,7 +126,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'
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div id="titlebar">
|
||||
<div id="titlebar" @dblclick="toggleFullScreen">
|
||||
<div class="titlebar-resizer" />
|
||||
<div class="titlebar-elements">
|
||||
<img
|
||||
|
@ -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