ADD: More shortcuts
This commit is contained in:
10
src/App.vue
10
src/App.vue
@@ -8,10 +8,16 @@ import { useStore } from '@/store'
|
||||
const { electron } = window
|
||||
const store = useStore()
|
||||
|
||||
const menuActions = {
|
||||
connect: () => store.setConnected(!store.connected),
|
||||
orientation: () => store.cycleScreenOrientation(),
|
||||
skin: () => store.switchPreviewDeviceModel(),
|
||||
}
|
||||
|
||||
electron.onMenu((key) => {
|
||||
console.log('menu', key)
|
||||
if(key==='connect') {
|
||||
store.setConnected(!store.connected)
|
||||
if (menuActions[key]) {
|
||||
menuActions[key]()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -46,11 +46,13 @@
|
||||
<MenubarItem class="flex justify-between" @click="store.cycleScreenOrientation">
|
||||
<p>Orientation: </p>
|
||||
<p>{{ store.screenOrientation }}°</p>
|
||||
<MenubarShortcut>⌘R</MenubarShortcut>
|
||||
</MenubarItem>
|
||||
<MenubarSeparator />
|
||||
<MenubarItem class="flex justify-between" @click="store.switchPreviewDeviceModel">
|
||||
<p>Skin: </p>
|
||||
<p>{{ previewDeviceNames[store.previewDeviceModel || 'nanoOne'] }}</p>
|
||||
<MenubarShortcut>⌘S</MenubarShortcut>
|
||||
</MenubarItem>
|
||||
<MenubarSeparator />
|
||||
<MenubarItem>{{ $t('navbar.device.export') }}
|
||||
|
||||
@@ -28,6 +28,8 @@ const appMenu = {
|
||||
submenu: {
|
||||
connect: { label: 'Connect', shortcut: 'CmdOrCtrl+D' },
|
||||
nextDevice: { label: 'Next Device', shortcut: 'CmdOrCtrl+N' },
|
||||
orientation: { label: 'Orientation', shortcut: 'CmdOrCtrl+R' },
|
||||
skin: { label: 'Skin', shortcut: 'CmdOrCtrl+S' },
|
||||
export: { label: 'Export Settings', shortcut: 'CmdOrCtrl+E' },
|
||||
import: { label: 'Import Settings', shortcut: 'CmdOrCtrl+I' },
|
||||
quit: { label: 'Quit', shortcut: 'CmdOrCtrl+Q', action: () => app.quit() },
|
||||
|
||||
Reference in New Issue
Block a user