From 3a34ef636af43e249fba417419db14c42b98094a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 21 Mar 2019 09:11:27 +0100 Subject: QMenu/QComboBox: Extract helper for determining the pop up geometry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Richard Moe Gustavsen --- src/widgets/styles/qstyle.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/widgets/styles/qstyle.cpp') 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 #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" -- cgit v1.2.3