ADD: Screen orientation button

This commit is contained in:
Robert Kossessa
2024-02-09 11:18:37 +01:00
parent 43132b452b
commit 099b6837a7
2 changed files with 8 additions and 4 deletions

View File

@@ -43,12 +43,12 @@
<MenubarShortcut>N</MenubarShortcut> <MenubarShortcut>N</MenubarShortcut>
</MenubarItem> </MenubarItem>
<MenubarSeparator /> <MenubarSeparator />
<MenubarItem @click="store.switchPreviewDeviceModel"> <MenubarItem @click.prevent="store.cycleScreenOrientation">
Skin: {{ previewDeviceNames[store.previewDeviceModel || 'nanoOne'] }} Orientation: {{ store.screenOrientation }}°
</MenubarItem> </MenubarItem>
<MenubarSeparator /> <MenubarSeparator />
<MenubarItem>{{ $t('navbar.device.preferences') }} <MenubarItem @click="store.switchPreviewDeviceModel">
<MenubarShortcut>,</MenubarShortcut> Skin: {{ previewDeviceNames[store.previewDeviceModel || 'nanoOne'] }}
</MenubarItem> </MenubarItem>
<MenubarSeparator /> <MenubarSeparator />
<MenubarItem>{{ $t('navbar.device.export') }} <MenubarItem>{{ $t('navbar.device.export') }}

View File

@@ -40,6 +40,7 @@ export const useStore = defineStore('main', {
}, },
}, },
previewDeviceModel: 'nanoOne', previewDeviceModel: 'nanoOne',
screenOrientation: 90,
} }
}, getters: { }, getters: {
profiles: (state) => state.profileCategories.flatMap(c => c.profiles), profiles: (state) => state.profileCategories.flatMap(c => c.profiles),
@@ -157,6 +158,9 @@ export const useStore = defineStore('main', {
switchPreviewDeviceModel() { switchPreviewDeviceModel() {
this.previewDeviceModel = this.previewDeviceModel === 'nanoOne' ? 'nanoZero' : 'nanoOne' this.previewDeviceModel = this.previewDeviceModel === 'nanoOne' ? 'nanoZero' : 'nanoOne'
}, },
cycleScreenOrientation() {
this.screenOrientation = (this.screenOrientation + 90) % 360
},
}, },
}) })