summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstyle.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-03-21 09:11:27 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-04-08 18:44:59 +0000
commit3a34ef636af43e249fba417419db14c42b98094a (patch)
treee5165267a4b48b7f3abebe408ab5e9122f094ec0 /src/widgets/styles/qstyle.cpp
parent8045ccc382ac91c14849e10f37d9a8d0605dc562 (diff)
QMenu/QComboBox: Extract helper for determining the pop up geometry
Move the code returning whether a popup should use the full screen to QStylePrivate and use for QMenu and QComboBox. Task-number: QTBUG-73231 Change-Id: I1901ecedfa90edf16329ce3b13ef4abea5ab44e8 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/styles/qstyle.cpp')
-rw-r--r--src/widgets/styles/qstyle.cpp8
1 files changed, 8 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"