Dialog: Hide when focus changes to ConfigView with hideOnWindowDeactivate
Differential Revision: https://phabricator.kde.org/D4282
This commit is contained in:
parent
ceeb57d17f
commit
d2c7435b1b
@ -25,6 +25,7 @@
|
|||||||
#include "../declarativeimports/core/framesvgitem.h"
|
#include "../declarativeimports/core/framesvgitem.h"
|
||||||
#include "dialogshadows_p.h"
|
#include "dialogshadows_p.h"
|
||||||
#include "view.h"
|
#include "view.h"
|
||||||
|
#include "configview.h"
|
||||||
|
|
||||||
#include <QQuickItem>
|
#include <QQuickItem>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
@ -1094,7 +1095,7 @@ void Dialog::focusOutEvent(QFocusEvent *ev)
|
|||||||
const QWindow *focusWindow = QGuiApplication::focusWindow();
|
const QWindow *focusWindow = QGuiApplication::focusWindow();
|
||||||
bool childHasFocus = focusWindow && ((focusWindow->isActive() && isAncestorOf(focusWindow)) || focusWindow->type() & Qt::Popup);
|
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)) {
|
if (viewClicked || (!parentHasFocus && !childHasFocus)) {
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user