mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-06 08:00:05 +00:00
27 lines
710 B
Vue
27 lines
710 B
Vue
<template>
|
|
<SidebarIcon
|
|
:icon="icon"
|
|
@click="toggleTheme"
|
|
:tooltip="$t('sideToolbar.themeToggle')"
|
|
class="comfy-vue-theme-toggle"
|
|
/>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
import SidebarIcon from './SidebarIcon.vue'
|
|
import { useSettingStore } from '@/stores/settingStore'
|
|
import { useCommandStore } from '@/stores/commandStore'
|
|
|
|
const settingStore = useSettingStore()
|
|
const currentTheme = computed(() => settingStore.get('Comfy.ColorPalette'))
|
|
const icon = computed(() =>
|
|
currentTheme.value !== 'light' ? 'pi pi-moon' : 'pi pi-sun'
|
|
)
|
|
|
|
const commandStore = useCommandStore()
|
|
const toggleTheme = () => {
|
|
commandStore.execute('Comfy.ToggleTheme')
|
|
}
|
|
</script>
|