diff options
author | Sami Merila <sami.merila@nokia.com> | 2010-04-15 11:53:24 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2010-04-15 11:53:24 (GMT) |
commit | a0b2992fe166bed4020e14fca9742ca3a7c9ae9e (patch) | |
tree | 96f7045f6b13c7d772b140b7e171d7ddb4d56878 | |
parent | 22df502bd5fcdb51bfcfa2e5d3f6fbf2d9fc3562 (diff) | |
download | Qt-a0b2992fe166bed4020e14fca9742ca3a7c9ae9e.zip Qt-a0b2992fe166bed4020e14fca9742ca3a7c9ae9e.tar.gz Qt-a0b2992fe166bed4020e14fca9742ca3a7c9ae9e.tar.bz2 |
ComboBox popuplist is not correctly layouted in fullscreen mode
This is partial fix to issue 9913.
Now combobox popup is correctly positioned with AVKON StaCon
(Combined Status and Control Pane). Popup is centered onscreen in
this case.
Task-number: QTBUG-9913
Reviewed-by: Janne Anttila
-rw-r--r-- | src/gui/widgets/qcombobox.cpp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index 7d02e14..12b1c4a 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -76,6 +76,10 @@ #ifndef QT_NO_EFFECTS # include <private/qeffects_p.h> #endif +#if defined(Q_WS_S60) +#include "private/qt_s60_p.h" +#endif + QT_BEGIN_NAMESPACE QComboBoxPrivate::QComboBoxPrivate() @@ -2449,11 +2453,16 @@ void QComboBox::showPopup() // in portait, menu should be positioned above softkeys listRect.moveBottom(screen.bottom()); } else { - // landscape, menu should be at the right and horizontally centered + TRect staConTopRect = TRect(); + AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStaconTop, staConTopRect); listRect.setWidth(listRect.height()); + //by default popup is centered on screen in landscape listRect.moveCenter(screen.center()); - (opt.direction == Qt::LeftToRight) ? listRect.setRight(screen.right()) : - listRect.setLeft(screen.left()); + if (staConTopRect.IsEmpty()) { + // landscape without stacon, menu should be at the right + (opt.direction == Qt::LeftToRight) ? listRect.setRight(screen.right()) : + listRect.setLeft(screen.left()); + } } #endif } else if (!boundToScreen || listRect.height() <= belowHeight) { @@ -2681,13 +2690,18 @@ void QComboBox::changeEvent(QEvent *e) // in portait, menu should be positioned above softkeys listRect.moveBottom(screen.bottom()); } else { - // landscape, menu should be at the right and horizontally centered + TRect staConTopRect = TRect(); + AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStaconTop, staConTopRect); listRect.setWidth(listRect.height()); + //by default popup is centered on screen in landscape listRect.moveCenter(screen.center()); - (opt.direction == Qt::LeftToRight) ? listRect.setRight(screen.right()) : - listRect.setLeft(screen.left()); + if (staConTopRect.IsEmpty()) { + // landscape without stacon, menu should be at the right + (opt.direction == Qt::LeftToRight) ? listRect.setRight(screen.right()) : + listRect.setLeft(screen.left()); + } + d->container->setGeometry(listRect); } - d->container->setGeometry(listRect); } } #endif |