From f06abbab79376e8b6a3a61a2594efc234157382b Mon Sep 17 00:00:00 2001 From: Sen66 Date: Thu, 5 Mar 2026 14:23:07 +0100 Subject: [PATCH] fix: on new class, switch to it --- src/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index e7d80fa..1ff1dc4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1572,6 +1572,16 @@ QDockWidget* MainWindow::createTab(RcxDocument* doc) { dock->raise(); dock->show(); + // Ensure the new dock's tab is activated in the tab bar + for (auto* tabBar : findChildren()) { + if (tabBar->parent() != this) continue; + for (int i = 0; i < tabBar->count(); i++) { + if (tabBar->tabText(i) == dock->windowTitle()) { + tabBar->setCurrentIndex(i); + break; + } + } + } // Install context menu on dock tab bars (deferred — tab bar created after tabification) QTimer::singleShot(0, this, [this]() {