mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-03 12:42:01 +00:00
feat: add settings option to always show advanced widgets on all nodes (#8244)
Solved issue: Currently, the display status of advanced widgets can only be set individually for each node, but users would like to have a global switch to always display all advanced widgets. I also adjusted some related code to solve the issue of code duplication. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8244-feat-add-settings-option-to-always-show-advanced-widgets-on-all-nodes-2f06d73d365081358023efa3e1ff3094) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
<div
|
||||
v-if="
|
||||
!widget.simplified.options?.hidden &&
|
||||
(!widget.simplified.options?.advanced || nodeData?.showAdvanced)
|
||||
(!widget.simplified.options?.advanced || showAdvanced)
|
||||
"
|
||||
class="lg-node-widget group col-span-full grid grid-cols-subgrid items-stretch"
|
||||
>
|
||||
@@ -78,6 +78,7 @@ import type {
|
||||
VueNodeData,
|
||||
WidgetSlotMetadata
|
||||
} from '@/composables/graph/useGraphNodeManager'
|
||||
import { useSettingStore } from '@/platform/settings/settingStore'
|
||||
import { useErrorHandling } from '@/composables/useErrorHandling'
|
||||
import { st } from '@/i18n'
|
||||
import { useCanvasInteractions } from '@/renderer/core/canvas/useCanvasInteractions'
|
||||
@@ -130,6 +131,12 @@ onErrorCaptured((error) => {
|
||||
})
|
||||
|
||||
const nodeType = computed(() => nodeData?.type || '')
|
||||
const settingStore = useSettingStore()
|
||||
const showAdvanced = computed(
|
||||
() =>
|
||||
nodeData?.showAdvanced ||
|
||||
settingStore.get('Comfy.Node.AlwaysShowAdvancedWidgets')
|
||||
)
|
||||
const { getWidgetTooltip, createTooltipConfig } = useNodeTooltips(
|
||||
nodeType.value
|
||||
)
|
||||
@@ -213,7 +220,7 @@ const gridTemplateRows = computed((): string => {
|
||||
(w) =>
|
||||
processedNames.has(w.name) &&
|
||||
!w.options?.hidden &&
|
||||
(!w.options?.advanced || nodeData?.showAdvanced)
|
||||
(!w.options?.advanced || showAdvanced.value)
|
||||
)
|
||||
.map((w) =>
|
||||
shouldExpand(w.type) || w.hasLayoutSize ? 'auto' : 'min-content'
|
||||
|
||||
Reference in New Issue
Block a user