Merge pull request #126 from toriphes/master

feat: added macos basic shortcusts and menu
This commit is contained in:
Fabio Di Stasio 2021-10-31 15:24:56 +01:00 committed by GitHub
commit cd1ebacf89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 3 deletions

View File

@ -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'

View File

@ -1,5 +1,5 @@
<template>
<div id="titlebar">
<div id="titlebar" @dblclick="toggleFullScreen">
<div class="titlebar-resizer" />
<div class="titlebar-elements">
<img

View File

@ -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
]
});

View 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');
});
};