Line data Source code
1 : <template>
2 2103 : <SidebarIcon
3 : icon="icon-[lucide--settings]"
4 : :label="$t('g.settings')"
5 : :tooltip="tooltipText"
6 : @click="showSettingsDialog"
7 : />
8 : </template>
9 :
10 : <script setup lang="ts">
11 : import { computed } from 'vue'
12 : import { useI18n } from 'vue-i18n'
13 :
14 : import { useTelemetry } from '@comfyorg/telemetry'
15 : import { useCommandStore } from '@/platform/keybindings/commandStore'
16 :
17 : import SidebarIcon from './SidebarIcon.vue'
18 :
19 2093 : const { t } = useI18n()
20 2093 : const { getCommand, formatKeySequence } = useCommandStore()
21 2093 : const command = getCommand('Comfy.ShowSettingsDialog')
22 :
23 2093 : const tooltipText = computed(
24 : () => `${t('g.settings')} (${formatKeySequence(command)})`
25 : )
26 :
27 : /**
28 : * Toggle keyboard shortcuts panel and track UI button click.
29 : */
30 2093 : const showSettingsDialog = () => {
31 0 : command.function()
32 0 : useTelemetry()?.trackUiButtonClicked({
33 : button_id: 'sidebar_settings_button_clicked',
34 : element_group: 'sidebar'
35 : })
36 : }
37 : </script>
|