mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-01 13:59:54 +00:00
Add unified sidebar width setting (#3605)
Co-authored-by: Benjamin Lu <templu1107@proton.me> Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<Splitter
|
||||
:key="activeSidebarTabId ?? undefined"
|
||||
:key="sidebarStateKey"
|
||||
class="splitter-overlay-root splitter-overlay"
|
||||
:pt:gutter="sidebarPanelVisible ? '' : 'hidden'"
|
||||
:state-key="activeSidebarTabId ?? undefined"
|
||||
:state-key="sidebarStateKey"
|
||||
state-storage="local"
|
||||
>
|
||||
<SplitterPanel
|
||||
@@ -59,6 +59,10 @@ const sidebarLocation = computed<'left' | 'right'>(() =>
|
||||
settingStore.get('Comfy.Sidebar.Location')
|
||||
)
|
||||
|
||||
const unifiedWidth = computed(() =>
|
||||
settingStore.get('Comfy.Sidebar.UnifiedWidth')
|
||||
)
|
||||
|
||||
const sidebarPanelVisible = computed(
|
||||
() => useSidebarTabStore().activeSidebarTab !== null
|
||||
)
|
||||
@@ -68,6 +72,10 @@ const bottomPanelVisible = computed(
|
||||
const activeSidebarTabId = computed(
|
||||
() => useSidebarTabStore().activeSidebarTabId
|
||||
)
|
||||
|
||||
const sidebarStateKey = computed(() => {
|
||||
return unifiedWidth.value ? 'unified-sidebar' : activeSidebarTabId.value ?? ''
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -88,6 +88,14 @@ export const CORE_SETTINGS: SettingParams[] = [
|
||||
// Default to small if the window is less than 1536px(2xl) wide.
|
||||
defaultValue: () => (window.innerWidth < 1536 ? 'small' : 'normal')
|
||||
},
|
||||
{
|
||||
id: 'Comfy.Sidebar.UnifiedWidth',
|
||||
category: ['Appearance', 'Sidebar', 'UnifiedWidth'],
|
||||
name: 'Unified sidebar width',
|
||||
type: 'boolean',
|
||||
defaultValue: true,
|
||||
versionAdded: '1.18.1'
|
||||
},
|
||||
{
|
||||
id: 'Comfy.TextareaWidget.FontSize',
|
||||
category: ['Appearance', 'Node Widget', 'TextareaWidget', 'FontSize'],
|
||||
|
||||
@@ -293,6 +293,9 @@
|
||||
"small": "small"
|
||||
}
|
||||
},
|
||||
"Comfy_Sidebar_UnifiedWidth": {
|
||||
"name": "Unified sidebar width"
|
||||
},
|
||||
"Comfy_SnapToGrid_GridSize": {
|
||||
"name": "Snap to grid size",
|
||||
"tooltip": "When dragging and resizing nodes while holding shift they will be aligned to the grid, this controls the size of that grid."
|
||||
|
||||
@@ -293,6 +293,9 @@
|
||||
"small": "pequeña"
|
||||
}
|
||||
},
|
||||
"Comfy_Sidebar_UnifiedWidth": {
|
||||
"name": "Ancho unificado de la barra lateral"
|
||||
},
|
||||
"Comfy_SnapToGrid_GridSize": {
|
||||
"name": "Tamaño de la cuadrícula para ajustar",
|
||||
"tooltip": "Al arrastrar y redimensionar nodos mientras se mantiene presionada la tecla shift, se alinearán a la cuadrícula, esto controla el tamaño de esa cuadrícula."
|
||||
|
||||
@@ -293,6 +293,9 @@
|
||||
"small": "petit"
|
||||
}
|
||||
},
|
||||
"Comfy_Sidebar_UnifiedWidth": {
|
||||
"name": "Largeur unifiée de la barre latérale"
|
||||
},
|
||||
"Comfy_SnapToGrid_GridSize": {
|
||||
"name": "Taille de la grille d'alignement",
|
||||
"tooltip": "Lors du déplacement et du redimensionnement des nœuds tout en maintenant shift, ils seront alignés sur la grille, cela contrôle la taille de cette grille."
|
||||
|
||||
@@ -293,6 +293,9 @@
|
||||
"small": "小"
|
||||
}
|
||||
},
|
||||
"Comfy_Sidebar_UnifiedWidth": {
|
||||
"name": "サイドバーの幅を統一"
|
||||
},
|
||||
"Comfy_SnapToGrid_GridSize": {
|
||||
"name": "グリッドサイズにスナップ",
|
||||
"tooltip": "シフトを押しながらノードをドラッグおよびサイズ変更すると、グリッドに整列されます。これにより、そのグリッドのサイズが制御されます。"
|
||||
|
||||
@@ -293,6 +293,9 @@
|
||||
"small": "작음"
|
||||
}
|
||||
},
|
||||
"Comfy_Sidebar_UnifiedWidth": {
|
||||
"name": "통합 사이드바 너비"
|
||||
},
|
||||
"Comfy_SnapToGrid_GridSize": {
|
||||
"name": "그리드 크기에 스냅",
|
||||
"tooltip": "Shift 키를 누른 상태에서 노드를 드래그하거나 크기를 조절하면 그리드에 맞춰 정렬됩니다. 이 설정은 그리드의 크기를 제어합니다."
|
||||
|
||||
@@ -293,6 +293,9 @@
|
||||
"small": "маленький"
|
||||
}
|
||||
},
|
||||
"Comfy_Sidebar_UnifiedWidth": {
|
||||
"name": "Унифицированная ширина боковой панели"
|
||||
},
|
||||
"Comfy_SnapToGrid_GridSize": {
|
||||
"name": "Размер сетки привязки",
|
||||
"tooltip": "При перетаскивании и изменении размера нод, удерживая shift, они будут выровнены по сетке, это контролирует размер этой сетки."
|
||||
|
||||
@@ -293,6 +293,9 @@
|
||||
"small": "小"
|
||||
}
|
||||
},
|
||||
"Comfy_Sidebar_UnifiedWidth": {
|
||||
"name": "统一侧边栏宽度"
|
||||
},
|
||||
"Comfy_SnapToGrid_GridSize": {
|
||||
"name": "吸附网格大小",
|
||||
"tooltip": "在按住shift拖动和调整节点大小时,节点将对齐到网格,该选项控制网格。"
|
||||
|
||||
@@ -384,6 +384,7 @@ const zSettings = z.object({
|
||||
'Comfy.PromptFilename': z.boolean(),
|
||||
'Comfy.Sidebar.Location': z.enum(['left', 'right']),
|
||||
'Comfy.Sidebar.Size': z.enum(['small', 'normal']),
|
||||
'Comfy.Sidebar.UnifiedWidth': z.boolean(),
|
||||
'Comfy.SwitchUser': z.any(),
|
||||
'Comfy.SnapToGrid.GridSize': z.number(),
|
||||
'Comfy.TextareaWidget.FontSize': z.number(),
|
||||
|
||||
Reference in New Issue
Block a user