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

View File

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