Dialog: Hide when focus changes to ConfigView with hideOnWindowDeactivate

Differential Revision: https://phabricator.kde.org/D4282
This commit is contained in:
David Rosca 2017-01-25 18:17:40 +01:00
parent ceeb57d17f
commit d2c7435b1b

View File

@ -25,6 +25,7 @@
#include "../declarativeimports/core/framesvgitem.h"
#include "dialogshadows_p.h"
#include "view.h"
#include "configview.h"
#include <QQuickItem>
#include <QTimer>
@ -1094,7 +1095,7 @@ void Dialog::focusOutEvent(QFocusEvent *ev)
const QWindow *focusWindow = QGuiApplication::focusWindow();
bool childHasFocus = focusWindow && ((focusWindow->isActive() && isAncestorOf(focusWindow)) || focusWindow->type() & Qt::Popup);
const bool viewClicked = qobject_cast<const KQuickAddons::QuickViewSharedEngine *>(focusWindow) || qobject_cast<const View *>(focusWindow);
const bool viewClicked = qobject_cast<const KQuickAddons::QuickViewSharedEngine *>(focusWindow) || qobject_cast<const View *>(focusWindow) || qobject_cast<const ConfigView *>(focusWindow);
if (viewClicked || (!parentHasFocus && !childHasFocus)) {
setVisible(false);