summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-04-10 17:33:14 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2019-04-10 17:33:14 +0000
commit63e88f60a769f2535945db0e1cabb9815ff45a77 (patch)
treecea2359bc9b5b4e3acce7aeca59a2f9b5d251bcb /src/widgets/styles
parent0bdded64accc3f654b2d12d9bfaf64f842cedf26 (diff)
parentff88e20b8328b6aad5b787aacc5c39da563a67b1 (diff)
Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" into refs/staging/5.13
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qstyle.cpp8
-rw-r--r--src/widgets/styles/qstyle_p.h3
2 files changed, 11 insertions, 0 deletions
diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp
index 97ec1d3f19..ec5b6df6b3 100644
--- a/src/widgets/styles/qstyle.cpp
+++ b/src/widgets/styles/qstyle.cpp
@@ -46,6 +46,7 @@
#include "qstyleoption.h"
#include "private/qstyle_p.h"
#include "private/qguiapplication_p.h"
+#include <qpa/qplatformtheme.h>
#ifndef QT_NO_DEBUG
#include "qdebug.h"
#endif
@@ -2447,6 +2448,13 @@ void QStyle::setProxy(QStyle *style)
d->proxyStyle = style;
}
+//Windows and KDE allow menus to cover the taskbar, while GNOME and macOS don't
+bool QStylePrivate::useFullScreenForPopup()
+{
+ auto theme = QGuiApplicationPrivate::platformTheme();
+ return theme && theme->themeHint(QPlatformTheme::UseFullScreenForPopupMenu).toBool();
+}
+
QT_END_NAMESPACE
#include "moc_qstyle.cpp"
diff --git a/src/widgets/styles/qstyle_p.h b/src/widgets/styles/qstyle_p.h
index cdea29f944..5bbde5fe17 100644
--- a/src/widgets/styles/qstyle_p.h
+++ b/src/widgets/styles/qstyle_p.h
@@ -67,6 +67,9 @@ class QStylePrivate: public QObjectPrivate
public:
inline QStylePrivate()
: layoutSpacingIndex(-1), proxyStyle(0) {}
+
+ static bool useFullScreenForPopup();
+
mutable int layoutSpacingIndex;
QStyle *proxyStyle;
};