Skip to content

Commit

Permalink
main-menu: Use simplified version when the window height is below 900
Browse files Browse the repository at this point in the history
Otherwise it gets in top of the bars or out of the screen.
  • Loading branch information
rafaellehmkuhl committed Jan 29, 2025
1 parent ba2e9c0 commit 95956e7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
<GlassButton
v-for="menuitem in currentSubMenu"
:key="menuitem.title"
:label="interfaceStore.isOnSmallScreen ? undefined : menuitem.title"
:label="simplifiedMainMenu ? undefined : menuitem.title"
:label-class="menuLabelSize"
:button-class="interfaceStore.isOnSmallScreen ? '-ml-[2px]' : ''"
:icon="menuitem.icon"
Expand Down Expand Up @@ -509,8 +509,10 @@ watch(isConfigModalVisible, (newVal) => {
}
})
const maxScreenHeightThatFitsLargeMenu = 900
watch(
() => windowHeight.value < 450,
() => windowHeight.value < maxScreenHeightThatFitsLargeMenu,
(isSmall: boolean) => {
simplifiedMainMenu.value = isSmall
}
Expand All @@ -522,7 +524,7 @@ const updateWindowHeight = (): void => {
onMounted(() => {
window.addEventListener('resize', updateWindowHeight)
if (windowHeight.value < 450) {
if (windowHeight.value < maxScreenHeightThatFitsLargeMenu) {
simplifiedMainMenu.value = true
}
})
Expand Down

0 comments on commit 95956e7

Please sign in to comment.