Fix Hidden Settings Menu

This patch fixes several problems of the settings menu related to
display on mobile devices or small(ish) windows:

- The `isMobileLandscape` is now calculated correctly. Previously, this
  was set to `true` if a device was in portrait mode.

- Showing the button to collapse the settings menu and making the menu
  collapsible now use the same mechanism. Previously, it could happen
  that the menu was opened and not fixed, but no button to close it
  again was shown.

- The icons fore opening and closing the settings menu are now both
  arrows, indicating that their functionality is reversed.

- The button to open the menu now always has the string “Settings”,
  instead of using the name of the current page. The current page hader
  is listed below that anyway and this is the action component to open
  the settings menu after all.

This fixes #1334
This commit is contained in:
Lars Kiesow 2023-01-01 19:41:46 +01:00
parent 70ba2f7850
commit 452af43916
No known key found for this signature in database
GPG key ID: 5DAFE8D9C823CE73
3 changed files with 16 additions and 12 deletions

View file

@ -2,9 +2,9 @@
<div id="page-wrapper" class="page p-2 md:p-6 overflow-y-auto relative" :class="streamLibraryItem ? 'streaming' : ''">
<app-config-side-nav :is-open.sync="sideDrawerOpen" />
<div class="configContent" :class="`page-${currentPage}`">
<div v-show="isMobile" class="w-full pb-4 px-2 flex border-b border-white border-opacity-10 mb-2">
<span class="material-icons text-2xl cursor-pointer" @click.stop.prevent="showMore">more_vert</span>
<p class="pl-3 capitalize">{{ currentPage }}</p>
<div v-show="isMobilePortrait" class="w-full pb-4 px-2 flex border-b border-white border-opacity-10 mb-2 cursor-pointer" @click.stop.prevent="toggleShowMore">
<span class="material-icons text-2xl cursor-pointer">arrow_forward</span>
<p class="pl-3 capitalize">{{ $strings.HeaderSettings }}</p>
</div>
<nuxt-child />
</div>
@ -35,8 +35,8 @@ export default {
}
},
computed: {
isMobile() {
return this.$store.state.globals.isMobile
isMobilePortrait() {
return this.$store.state.globals.isMobilePortrait
},
streamLibraryItem() {
return this.$store.state.streamLibraryItem
@ -60,8 +60,8 @@ export default {
}
},
methods: {
showMore() {
this.sideDrawerOpen = true
toggleShowMore() {
this.sideDrawerOpen = !this.sideDrawerOpen
},
setDeveloperMode() {
var value = !this.$store.state.developerMode