Also hide overlay when clicking on empty space of a main window

This commit is contained in:
Sergio Martins
2021-02-04 19:54:11 +00:00
parent e745d38b1e
commit 7caa83be19
3 changed files with 11 additions and 2 deletions

View File

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

View File

@@ -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();
}

View File

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