src/gui/widgets/qcombobox.cpp
changeset 22 79de32ba3296
parent 19 fcece45ef507
child 25 e24348a560a6
--- a/src/gui/widgets/qcombobox.cpp	Mon May 03 13:17:34 2010 +0300
+++ b/src/gui/widgets/qcombobox.cpp	Fri May 14 16:40:13 2010 +0300
@@ -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 @@
             // 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 @@
                     // 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