From ecb954f9e2e0a82443feb22e4e188db3e6d22a0a Mon Sep 17 00:00:00 2001 From: IChooseYou Date: Sun, 15 Mar 2026 18:50:40 -0600 Subject: [PATCH] fix: dock tab sizing and scanner dock area restrictions - Add 24px width padding to dock tab size calculation to account for DockTabButtons close icon (prevents text clipping into button area) - Enable scroll buttons on dock tab bars so tabs scroll instead of compressing when they overflow - Allow scanner dock to be docked on all sides (was missing TopDockWidgetArea) --- src/main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 444e321..95ae507 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -260,11 +260,12 @@ public: s = QSize(s.width() + 24, s.height() + 4); if (type == CT_ItemViewItem) s.setHeight(s.height() + 4); - // Dock tab bar: fixed height, reasonable padding + // Dock tab bar: fixed height + extra width for close button if (type == CT_TabBarTab) { if (auto* tabBar = qobject_cast(w)) { if (tabBar->parent() && qobject_cast(tabBar->parent())) { s.setHeight(31); + s.setWidth(s.width() + 24); // room for DockTabButtons (16px icon + padding) } } } @@ -2046,6 +2047,7 @@ void MainWindow::setupDockTabBars() { tabBar->setAttribute(Qt::WA_Hover, true); tabBar->setElideMode(Qt::ElideNone); tabBar->setExpanding(false); + tabBar->setUsesScrollButtons(true); // Set editor font so tab width sizing matches our label painting { QSettings s("Reclass", "Reclass"); @@ -4598,8 +4600,7 @@ void MainWindow::createWorkspaceDock() { void MainWindow::createScannerDock() { m_scannerDock = new QDockWidget("Scanner", this); m_scannerDock->setObjectName("ScannerDock"); - m_scannerDock->setAllowedAreas( - Qt::BottomDockWidgetArea | Qt::RightDockWidgetArea | Qt::LeftDockWidgetArea); + m_scannerDock->setAllowedAreas(Qt::AllDockWidgetAreas); m_scannerDock->setFeatures( QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);