mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-24 23:31:32 +08:00
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:
parent
0ebc170cfa
commit
1abe101ef7
@ -407,7 +407,7 @@ void CDockWidgetTab::mouseReleaseEvent(QMouseEvent* ev)
|
|||||||
}
|
}
|
||||||
else if (ev->button() == Qt::MiddleButton)
|
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
|
// Only attempt to close if the mouse is still
|
||||||
// on top of the widget, to allow the user to cancel.
|
// on top of the widget, to allow the user to cancel.
|
||||||
|
Loading…
Reference in New Issue
Block a user