mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-20 23:04:06 +00:00
Update minimap and graph canvas menu (bottom right) to use menu tokens. Change canvas BG color on default dark theme. <img width="3840" height="2029" alt="image" src="https://github.com/user-attachments/assets/6d168981-df27-40c0-829c-59150b8a6a12" /> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6589-wip-Style-graph-canvas-color-2a26d73d365081cb88c4c4bdb2b6d3a5) by [Unito](https://www.unito.io) --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Alexander Brown <drjkl@comfy.org>
86 lines
2.1 KiB
Vue
86 lines
2.1 KiB
Vue
<template>
|
|
<Button
|
|
v-if="!isLoggedIn"
|
|
outlined
|
|
rounded
|
|
severity="secondary"
|
|
class="size-8 border-black/50 bg-transparent text-black hover:bg-interface-panel-hover-surface dark-theme:border-white/50 dark-theme:text-white"
|
|
@click="handleSignIn()"
|
|
@mouseenter="showPopover"
|
|
@mouseleave="hidePopover"
|
|
>
|
|
<template #icon>
|
|
<i class="icon-[lucide--user] size-4" />
|
|
</template>
|
|
</Button>
|
|
<Popover
|
|
ref="popoverRef"
|
|
class="p-2"
|
|
@mouseout="hidePopover"
|
|
@mouseover="cancelHidePopover"
|
|
>
|
|
<div>
|
|
<div class="mb-1">{{ t('auth.loginButton.tooltipHelp') }}</div>
|
|
<a
|
|
href="https://docs.comfy.org/tutorials/api-nodes/overview#api-nodes"
|
|
target="_blank"
|
|
class="text-neutral-500 hover:text-primary"
|
|
>{{ t('auth.loginButton.tooltipLearnMore') }}</a
|
|
>
|
|
</div>
|
|
</Popover>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import Button from 'primevue/button'
|
|
import Popover from 'primevue/popover'
|
|
import { ref } from 'vue'
|
|
|
|
import { useCurrentUser } from '@/composables/auth/useCurrentUser'
|
|
import { t } from '@/i18n'
|
|
|
|
const { isLoggedIn, handleSignIn } = useCurrentUser()
|
|
const popoverRef = ref<InstanceType<typeof Popover> | null>(null)
|
|
let hideTimeout: ReturnType<typeof setTimeout> | null = null
|
|
let showTimeout: ReturnType<typeof setTimeout> | null = null
|
|
|
|
const showPopover = (event: Event) => {
|
|
// Clear any existing timeouts
|
|
if (hideTimeout) {
|
|
clearTimeout(hideTimeout)
|
|
hideTimeout = null
|
|
}
|
|
if (showTimeout) {
|
|
clearTimeout(showTimeout)
|
|
showTimeout = null
|
|
}
|
|
|
|
showTimeout = setTimeout(() => {
|
|
if (popoverRef.value) {
|
|
popoverRef.value.show(event, event.target as HTMLElement)
|
|
}
|
|
}, 200)
|
|
}
|
|
|
|
const cancelHidePopover = () => {
|
|
if (hideTimeout) {
|
|
clearTimeout(hideTimeout)
|
|
hideTimeout = null
|
|
}
|
|
}
|
|
|
|
const hidePopover = () => {
|
|
// Clear show timeout if mouse leaves before popover appears
|
|
if (showTimeout) {
|
|
clearTimeout(showTimeout)
|
|
showTimeout = null
|
|
}
|
|
|
|
hideTimeout = setTimeout(() => {
|
|
if (popoverRef.value) {
|
|
popoverRef.value.hide()
|
|
}
|
|
}, 150) // Minimal delay to allow moving to popover
|
|
}
|
|
</script>
|