mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-05 23:50:08 +00:00
56 lines
1.5 KiB
Vue
56 lines
1.5 KiB
Vue
<template>
|
|
<Button
|
|
v-show="workspaceState.focusMode"
|
|
class="comfy-menu-hamburger"
|
|
:style="positionCSS"
|
|
icon="pi pi-bars"
|
|
severity="secondary"
|
|
text
|
|
size="large"
|
|
v-tooltip="{ value: $t('menu.showMenu'), showDelay: 300 }"
|
|
@click="exitFocusMode"
|
|
/>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import Button from 'primevue/button'
|
|
import { useWorkspaceStore } from '@/stores/workspaceStore'
|
|
import { computed, CSSProperties, watchEffect } from 'vue'
|
|
import { app } from '@/scripts/app'
|
|
import { useSettingStore } from '@/stores/settingStore'
|
|
|
|
const workspaceState = useWorkspaceStore()
|
|
const settingStore = useSettingStore()
|
|
const exitFocusMode = () => {
|
|
workspaceState.focusMode = false
|
|
}
|
|
|
|
watchEffect(() => {
|
|
if (settingStore.get('Comfy.UseNewMenu') !== 'Disabled') {
|
|
return
|
|
}
|
|
if (workspaceState.focusMode) {
|
|
app.ui.menuContainer.style.display = 'none'
|
|
} else {
|
|
app.ui.menuContainer.style.display = 'block'
|
|
}
|
|
})
|
|
|
|
const menuSetting = computed(() => settingStore.get('Comfy.UseNewMenu'))
|
|
const positionCSS = computed<CSSProperties>(() =>
|
|
// 'Bottom' menuSetting shows the hamburger button in the bottom right corner
|
|
// 'Disabled', 'Top' menuSetting shows the hamburger button in the top right corner
|
|
menuSetting.value === 'Bottom'
|
|
? { bottom: '0px', right: '0px' }
|
|
: { top: '0px', right: '0px' }
|
|
)
|
|
</script>
|
|
|
|
<style scoped>
|
|
.comfy-menu-hamburger {
|
|
pointer-events: auto;
|
|
position: fixed;
|
|
z-index: 9999;
|
|
}
|
|
</style>
|