summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-02-27 17:09:43 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-28 09:12:03 +0100
commit838f828a1d76c1f9fc1fba669d336e91f622fb94 (patch)
tree260e4343701639fa509d8c4fad66fccb357c1d6c /src
parent52dab549868d41fbfb6f3f612c380fb750755aa3 (diff)
QComboBox: Use platform theme hint to determine popup geometry.
Change-Id: I1f81be1394455715c5dfcd2d426758c4c7cd91fc Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/widgets/qcombobox.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index d6af8d6044..c5f5d6e6e1 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -43,6 +43,7 @@
#ifndef QT_NO_COMBOBOX
#include <qstylepainter.h>
+#include <qplatformtheme_qpa.h>
#include <qlineedit.h>
#include <qapplication.h>
#include <qdesktopwidget.h>
@@ -57,15 +58,13 @@
#include <qtreeview.h>
#include <qheaderview.h>
#include <qmath.h>
+#include <private/qguiapplication_p.h>
#include <private/qapplication_p.h>
#include <private/qcombobox_p.h>
#include <private/qabstractitemmodel_p.h>
#include <private/qabstractscrollarea_p.h>
#include <private/qsoftkeymanager_p.h>
#include <qdebug.h>
-#ifdef Q_WS_X11
-#include <private/qt_x11_p.h>
-#endif
#if defined(Q_WS_MAC) && !defined(QT_NO_EFFECTS) && !defined(QT_NO_STYLE_MAC)
#include <private/qcore_mac_p.h>
#include <QMacStyle>
@@ -219,16 +218,12 @@ void QComboBoxPrivate::_q_modelDestroyed()
//Windows and KDE allows menus to cover the taskbar, while GNOME and Mac don't
QRect QComboBoxPrivate::popupGeometry(int screen) const
{
-#ifdef Q_WS_WIN
- return QApplication::desktop()->screenGeometry(screen);
-#elif defined Q_WS_X11
- if (X11->desktopEnvironment == DE_KDE)
- return QApplication::desktop()->screenGeometry(screen);
- else
- return QApplication::desktop()->availableGeometry(screen);
-#else
- return QApplication::desktop()->availableGeometry(screen);
-#endif
+ bool useFullScreenForPopupMenu = false;
+ if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme())
+ useFullScreenForPopupMenu = theme->themeHint(QPlatformTheme::UseFullScreenForPopupMenu).toBool();
+ return useFullScreenForPopupMenu ?
+ QApplication::desktop()->screenGeometry(screen) :
+ QApplication::desktop()->availableGeometry(screen);
}
bool QComboBoxPrivate::updateHoverControl(const QPoint &pos)