diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-09-22 10:09:05 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-09-23 05:14:51 +0000 |
commit | 3ca980f2011384ee65bc8c49cbcacadf50872eb8 (patch) | |
tree | 0ddbd0a724e37b9630dcdad35482cc613597294a /src | |
parent | 7193318330bc518255fb7ed008c144578f49b4bd (diff) |
Drawer: allow interaction outside modal background dimming
If a drawer is positioned below a toolbar, for instance, it must be
possible to interact with the buttons in the toolbar while the drawer
is open (without the drawer closing due to the interaction).
Change-Id: I5e07f66ad997ba6cf991a26fc6849ec51c9c0a22
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/quicktemplates2/qquickdrawer.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/quicktemplates2/qquickdrawer.cpp b/src/quicktemplates2/qquickdrawer.cpp index 80cd95c9..8319cf2c 100644 --- a/src/quicktemplates2/qquickdrawer.cpp +++ b/src/quicktemplates2/qquickdrawer.cpp @@ -369,8 +369,11 @@ bool QQuickDrawerPrivate::handleMousePressEvent(QQuickItem *item, QMouseEvent *e pressPoint = event->windowPos(); velocityCalculator.startMeasuring(pressPoint, event->timestamp()); - // don't block press events a) outside a non-modal drawer, or b) to drawer children - event->setAccepted(modal && !popupItem->isAncestorOf(item)); + // don't block press events + // a) outside a non-modal drawer, + // b) to drawer children, or + // c) outside a modal drawer's background dimming + event->setAccepted(modal && !popupItem->isAncestorOf(item) && (!dimmer || dimmer->contains(dimmer->mapFromScene(pressPoint)))); return event->isAccepted(); } |