From c0695b3911f99132e7de5df9a9fa676f2df33721 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 22 Jul 2016 07:29:26 +0200 Subject: Fix hover event handling for drawer overlays Closed drawers sit visible at the window edge to be able to pull them out. Don't block hover events when drawers are fully closed ie. when their overlays are fully translucent. Task-number: QTBUG-53419 Change-Id: I5bdbed5a2cf3ad6972634432ac79f7fbe5054b98 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickdrawer.cpp | 6 +++++- src/quicktemplates2/qquickoverlay.cpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/quicktemplates2') diff --git a/src/quicktemplates2/qquickdrawer.cpp b/src/quicktemplates2/qquickdrawer.cpp index c165b077..fe0a3c72 100644 --- a/src/quicktemplates2/qquickdrawer.cpp +++ b/src/quicktemplates2/qquickdrawer.cpp @@ -431,8 +431,12 @@ void QQuickDrawer::setPosition(qreal position) d->position = position; if (isComponentComplete()) d->reposition(); - if (d->dimmer) + if (d->dimmer) { d->dimmer->setOpacity(position); + // TODO: check QStyleHints::useHoverEffects in Qt 5.8 + d->dimmer->setAcceptHoverEvents(d->modal && position > 0.0); + // d->dimmer->setAcceptHoverEvents(d->modal && position > 0.0 && QGuiApplication::styleHints()->useHoverEffects()); + } emit positionChanged(); } diff --git a/src/quicktemplates2/qquickoverlay.cpp b/src/quicktemplates2/qquickoverlay.cpp index 028fa7b1..2e19e02d 100644 --- a/src/quicktemplates2/qquickoverlay.cpp +++ b/src/quicktemplates2/qquickoverlay.cpp @@ -108,7 +108,7 @@ static QQuickItem *createDimmer(QQmlComponent *component, QQuickPopup *popup, QQ item->setParentItem(parent); item->stackBefore(popup->popupItem()); item->setZ(popup->z()); - if (popup->isModal()) { + if (popup->isModal() && !qobject_cast(popup)) { // TODO: switch to QStyleHints::useHoverEffects in Qt 5.8 item->setAcceptHoverEvents(true); // item->setAcceptHoverEvents(QGuiApplication::styleHints()->useHoverEffects()); -- cgit v1.2.3