Also hide overlay when clicking on empty space of a main window
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
- DockWidgetBase::eventFilter() is protected instead of private (regression vs v1.1) (#148)
|
||||
It's recommended that you rebuild your application when updating KDDW, as MSVC encodes private/protected in the name mangling.
|
||||
- Fixed WASM build on Windows (#163)
|
||||
- Fixed sidebar overlay not getting hidden when clicking on the main window docking area (#157)
|
||||
|
||||
* v1.2.0 (17 December 2020)
|
||||
- Wayland support
|
||||
|
||||
@@ -636,7 +636,16 @@ bool DockRegistry::eventFilter(QObject *watched, QEvent *event)
|
||||
auto p = watched;
|
||||
while (p) {
|
||||
if (auto dw = qobject_cast<DockWidgetBase*>(p))
|
||||
return onDockWidgetPressed(dw, static_cast<QMouseEvent*>(event));
|
||||
return onDockWidgetPressed(dw, static_cast<QMouseEvent *>(event));
|
||||
|
||||
if (auto dropArea = qobject_cast<DropArea *>(p)) {
|
||||
if (auto mw = dropArea->mainWindow()) {
|
||||
// The user clicked somewhere in the main window's drop area, but outside of the
|
||||
// overlayed dock widget
|
||||
mw->clearSideBarOverlay();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
p = p->parent();
|
||||
}
|
||||
|
||||
@@ -5263,7 +5263,6 @@ void TestDocks::tst_sidebarOverlayGetsHiddenOnClick()
|
||||
|
||||
const QPoint localPt(100, 250);
|
||||
Tests::clickOn(m1->mapToGlobal(m1->rect().topLeft() + localPt), m1->childAt(localPt));
|
||||
QEXPECT_FAIL("", "will fix", Continue);
|
||||
QVERIFY(!dw1->isOverlayed());
|
||||
|
||||
delete dw1;
|
||||
|
||||
Reference in New Issue
Block a user