mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 18:52:19 +00:00
Add side bar location in settings (left/right) (#396)
* Allow side bar on right side * Panel on the right
This commit is contained in:
@@ -70,8 +70,13 @@ const shouldShowBadge = computed(() => !!overlayValue.value)
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.side-bar-button.side-bar-button-selected,
|
||||
.side-bar-button.side-bar-button-selected:hover {
|
||||
.comfyui-body-left .side-bar-button.side-bar-button-selected,
|
||||
.comfyui-body-left .side-bar-button.side-bar-button-selected:hover {
|
||||
border-left: 4px solid var(--p-button-text-primary-color);
|
||||
}
|
||||
|
||||
.comfyui-body-right .side-bar-button.side-bar-button-selected,
|
||||
.comfyui-body-right .side-bar-button.side-bar-button-selected:hover {
|
||||
border-right: 4px solid var(--p-button-text-primary-color);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<teleport to=".comfyui-body-left">
|
||||
<teleport :to="teleportTarget">
|
||||
<nav class="side-tool-bar-container">
|
||||
<SideBarIcon
|
||||
v-for="tab in tabs"
|
||||
@@ -40,12 +40,21 @@ import SideBarThemeToggleIcon from './SideBarThemeToggleIcon.vue'
|
||||
import SideBarSettingsToggleIcon from './SideBarSettingsToggleIcon.vue'
|
||||
import { computed, onBeforeUnmount } from 'vue'
|
||||
import { useWorkspaceStore } from '@/stores/workspaceStateStore'
|
||||
import { useSettingStore } from '@/stores/settingStore'
|
||||
import {
|
||||
CustomSidebarTabExtension,
|
||||
SidebarTabExtension
|
||||
} from '@/types/extensionTypes'
|
||||
|
||||
const workspaceStore = useWorkspaceStore()
|
||||
const settingStore = useSettingStore()
|
||||
|
||||
const teleportTarget = computed(() =>
|
||||
settingStore.get('Comfy.SideBar.Location') === 'left'
|
||||
? '.comfyui-body-left'
|
||||
: '.comfyui-body-right'
|
||||
)
|
||||
|
||||
const tabs = computed(() => workspaceStore.getSidebarTabs())
|
||||
const selectedTab = computed<SidebarTabExtension | null>(() => {
|
||||
const tabId = workspaceStore.activeSidebarTab
|
||||
|
||||
Reference in New Issue
Block a user