From dba76ea9f2c0dc081dad14075c65af1eb8caa011 Mon Sep 17 00:00:00 2001 From: Mike Solar Date: Mon, 13 Jul 2026 02:23:54 +0800 Subject: [PATCH] Switch to the correct dock/tab when jumping to parameter editor In NodeParamView::SetSelectedNodes, after locating the target node item, expand and raise its containing NodeParamViewContext dock widget so the active tab/folded section switches to the one that actually holds the node. --- app/widget/nodeparamview/nodeparamview.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/widget/nodeparamview/nodeparamview.cpp b/app/widget/nodeparamview/nodeparamview.cpp index fa0697ba9..d337c368e 100644 --- a/app/widget/nodeparamview/nodeparamview.cpp +++ b/app/widget/nodeparamview/nodeparamview.cpp @@ -509,6 +509,7 @@ void NodeParamView::SetSelectedNodes(const QVector &nodes, bool emit_signal) { QVector items; + NodeParamViewContext *scrolled_ctx = nullptr; foreach (const Node::ContextPair &n, nodes) { for (auto it = context_items_.cbegin(); it != context_items_.cend(); @@ -519,6 +520,9 @@ void NodeParamView::SetSelectedNodes(const QVector &nodes, if (item) { items.append(item); + if (!scrolled_ctx) { + scrolled_ctx = ctx; + } } } } @@ -533,6 +537,12 @@ void NodeParamView::SetSelectedNodes(const QVector &nodes, param_scroll_area_, scrolled_to->geometry().topLeft()); param_scroll_area_->verticalScrollBar()->setValue(viewport_pos.y()); + + // Make sure the dock/tab containing this node is visible + if (scrolled_ctx) { + scrolled_ctx->SetExpanded(true); + scrolled_ctx->raise(); + } } }