From 1abe101ef762190b228a712d4f454e26b0bbb8f3 Mon Sep 17 00:00:00 2001 From: Ben Hetherington Date: Tue, 16 Nov 2021 05:24:39 +0000 Subject: [PATCH] Prevent middle-click from closing unclosable tabs (#372) This fixes a bug whereby you could close a dock widget by middle-clicking its tab, even if its `CDockWidget::DockWidgetClosable` flag is set to `false`. --- src/DockWidgetTab.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DockWidgetTab.cpp b/src/DockWidgetTab.cpp index 968bb6f..0ad3882 100644 --- a/src/DockWidgetTab.cpp +++ b/src/DockWidgetTab.cpp @@ -407,7 +407,7 @@ void CDockWidgetTab::mouseReleaseEvent(QMouseEvent* ev) } else if (ev->button() == Qt::MiddleButton) { - if (CDockManager::testConfigFlag(CDockManager::MiddleMouseButtonClosesTab)) + if (CDockManager::testConfigFlag(CDockManager::MiddleMouseButtonClosesTab) && dockWidget->features().testFlag(CDockWidget::DockWidgetClosable)) { // Only attempt to close if the mouse is still // on top of the widget, to allow the user to cancel.