Skip to content

Commit ab43b5e

Browse files
Menu bar mobile behavior change (#4312)
1 parent 43f73f8 commit ab43b5e

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/constants/coreSettings.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,8 @@ export const CORE_SETTINGS: SettingParams[] = [
440440
name: 'Use new menu',
441441
type: 'combo',
442442
options: ['Disabled', 'Top', 'Bottom'],
443+
tooltip:
444+
'Menu bar position. On mobile devices, the menu is always shown at the top.',
443445
migrateDeprecatedValue: (value: string) => {
444446
// Floating is now supported by dragging the docked actionbar off.
445447
if (value === 'Floating') {

src/views/GraphView.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<template>
22
<div class="comfyui-body grid h-full w-full overflow-hidden">
33
<div id="comfyui-body-top" class="comfyui-body-top">
4-
<TopMenubar v-if="useNewMenu === 'Top'" />
4+
<TopMenubar v-if="showTopMenu" />
55
</div>
66
<div id="comfyui-body-bottom" class="comfyui-body-bottom">
7-
<TopMenubar v-if="useNewMenu === 'Bottom'" />
7+
<TopMenubar v-if="showBottomMenu" />
88
</div>
99
<div id="comfyui-body-left" class="comfyui-body-left" />
1010
<div id="comfyui-body-right" class="comfyui-body-right" />
@@ -20,7 +20,7 @@
2020
</template>
2121

2222
<script setup lang="ts">
23-
import { useEventListener } from '@vueuse/core'
23+
import { useBreakpoints, useEventListener } from '@vueuse/core'
2424
import type { ToastMessageOptions } from 'primevue/toast'
2525
import { useToast } from 'primevue/usetoast'
2626
import { computed, onBeforeUnmount, onMounted, watch, watchEffect } from 'vue'
@@ -70,6 +70,12 @@ const settingStore = useSettingStore()
7070
const executionStore = useExecutionStore()
7171
const colorPaletteStore = useColorPaletteStore()
7272
const queueStore = useQueueStore()
73+
const breakpoints = useBreakpoints({ md: 961 })
74+
const isMobile = breakpoints.smaller('md')
75+
const showTopMenu = computed(() => isMobile.value || useNewMenu.value === 'Top')
76+
const showBottomMenu = computed(
77+
() => !isMobile.value && useNewMenu.value === 'Bottom'
78+
)
7379
7480
watch(
7581
() => colorPaletteStore.completedActivePalette,

0 commit comments

Comments
 (0)