diff options
author | Sami Merila <sami.merila@nokia.com> | 2011-03-15 06:32:22 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2011-03-15 06:32:22 (GMT) |
commit | d919343e91fd5e6771f11cb59d4730ec83ed7381 (patch) | |
tree | 117eaabddcffe4b8053f45c3e2f5647913e740e6 /src/gui | |
parent | e546b6b38f95e6496fd53efba41442cde879819a (diff) | |
download | Qt-d919343e91fd5e6771f11cb59d4730ec83ed7381.zip Qt-d919343e91fd5e6771f11cb59d4730ec83ed7381.tar.gz Qt-d919343e91fd5e6771f11cb59d4730ec83ed7381.tar.bz2 |
Remove changes from fix to QTBUG-17045 that were not related to the fix
There were changes included in the fix for QTBUG-17045 that were not
supposed to be part of that fix. These changes to qcombobox.cpp are
now removed.
Task-number: QTBUG-17045
Reviewed-by: TrustMe
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/widgets/qcombobox.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index af2440a..dbbf49a 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -2348,7 +2348,7 @@ void QComboBox::showPopup() initStyleOption(&opt); QRect listRect(style->subControlRect(QStyle::CC_ComboBox, &opt, QStyle::SC_ComboBoxListBoxPopup, this)); - QRect screen = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect()); + QRect screen = d->popupGeometry(QApplication::desktop()->screenNumber(this)); QPoint below = mapToGlobal(listRect.bottomLeft()); int belowHeight = screen.bottom() - below.y(); QPoint above = mapToGlobal(listRect.topLeft()); @@ -2476,10 +2476,18 @@ void QComboBox::showPopup() listRect.setWidth(listRect.height()); //by default popup is centered on screen in landscape listRect.moveCenter(screen.center()); - if (staConTopRect.IsEmpty() && AknLayoutUtils::CbaLocation() != AknLayoutUtils::EAknCbaLocationBottom) { - // landscape without stacon, menu should be at the right - (opt.direction == Qt::LeftToRight) ? listRect.setRight(screen.right()) : - listRect.setLeft(screen.left()); + if (staConTopRect.IsEmpty()) { + TRect cbaRect = TRect(); + AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, cbaRect); + AknLayoutUtils::TAknCbaLocation cbaLocation = AknLayoutUtils::CbaLocation(); + switch (cbaLocation) { + case AknLayoutUtils::EAknCbaLocationRight: + listRect.setRight(screen.right()); + break; + case AknLayoutUtils::EAknCbaLocationLeft: + listRect.setLeft(screen.left()); + break; + } } } #endif @@ -2698,7 +2706,7 @@ void QComboBox::changeEvent(QEvent *e) initStyleOption(&opt); if (style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, this)) { - QRect screen = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect()); + const QRect screen = d->popupGeometry(QApplication::desktop()->screenNumber(this)); QRect listRect(style()->subControlRect(QStyle::CC_ComboBox, &opt, QStyle::SC_ComboBoxListBoxPopup, this)); @@ -2713,13 +2721,13 @@ void QComboBox::changeEvent(QEvent *e) listRect.setWidth(listRect.height()); //by default popup is centered on screen in landscape listRect.moveCenter(screen.center()); - if (staConTopRect.IsEmpty() && AknLayoutUtils::CbaLocation() != AknLayoutUtils::EAknCbaLocationBottom) { + 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 @@ -2752,10 +2760,6 @@ void QComboBox::changeEvent(QEvent *e) void QComboBox::resizeEvent(QResizeEvent *) { Q_D(QComboBox); -#ifdef Q_WS_S60 - if (d->viewContainer() && d->viewContainer()->isVisible()) - showPopup(); -#endif d->updateLineEditGeometry(); } |