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`.
This commit is contained in:
Ben Hetherington
2021-11-16 05:24:39 +00:00
committed by GitHub
parent 0ebc170cfa
commit 1abe101ef7

View File

@@ -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.