mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-06 08:00:05 +00:00
## Summary Opens settings with a single click! <img width="247" height="252" alt="image" src="https://github.com/user-attachments/assets/c571d5e0-4973-4570-a542-fff343364ec0" /> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6892-Feat-Restore-settings-button-to-the-sidebar-2b56d73d36508102a48aec318d468303) by [Unito](https://www.unito.io) --------- Co-authored-by: github-actions <github-actions@github.com>
40 lines
943 B
Vue
40 lines
943 B
Vue
<template>
|
|
<SidebarIcon
|
|
:label="$t('g.settings')"
|
|
:tooltip="tooltipText"
|
|
@click="showSettingsDialog"
|
|
>
|
|
<template #icon>
|
|
<i class="icon-[lucide--settings]" />
|
|
</template>
|
|
</SidebarIcon>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
import { useTelemetry } from '@/platform/telemetry'
|
|
import { useCommandStore } from '@/stores/commandStore'
|
|
|
|
import SidebarIcon from './SidebarIcon.vue'
|
|
|
|
const { t } = useI18n()
|
|
const { getCommand, formatKeySequence } = useCommandStore()
|
|
const command = getCommand('Comfy.ShowSettingsDialog')
|
|
|
|
const tooltipText = computed(
|
|
() => `${t('g.settings')} (${formatKeySequence(command)})`
|
|
)
|
|
|
|
/**
|
|
* Toggle keyboard shortcuts panel and track UI button click.
|
|
*/
|
|
const showSettingsDialog = () => {
|
|
command.function()
|
|
useTelemetry()?.trackUiButtonClicked({
|
|
button_id: 'sidebar_settings_button_clicked'
|
|
})
|
|
}
|
|
</script>
|