src/gui/dialogs/qdialog.cpp
changeset 22 79de32ba3296
parent 19 fcece45ef507
child 30 5dc02b23752f
--- a/src/gui/dialogs/qdialog.cpp	Mon May 03 13:17:34 2010 +0300
+++ b/src/gui/dialogs/qdialog.cpp	Fri May 14 16:40:13 2010 +0300
@@ -904,26 +904,33 @@
             } else {
                 cbaHeight = qt_TSize2QSize(bgContainer->Size()).height();
             }
-            p.setY(S60->screenHeightInPixels-height()-cbaHeight);
+            p.setY(S60->screenHeightInPixels - height() - cbaHeight);
             p.setX(0);
         } else {
             const int scrollbarWidth = style()->pixelMetric(QStyle::PM_ScrollBarExtent);
-            TRect cbaRect = TRect();
-            AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, cbaRect);
-            AknLayoutUtils::TAknCbaLocation cbaLocation = AknLayoutUtils::CbaLocation();
-            switch (cbaLocation) {
-            case AknLayoutUtils::EAknCbaLocationBottom:
-                p.setY(S60->screenHeightInPixels - height()-cbaRect.Height());
-                p.setX((S60->screenWidthInPixels - width())>>1);
-                break;
-            case AknLayoutUtils::EAknCbaLocationRight:
-                p.setY((S60->screenHeightInPixels - height())>>1);
-                p.setX(qMax(0,S60->screenWidthInPixels-width()-scrollbarWidth-cbaRect.Width()));
-                break;
-            case AknLayoutUtils::EAknCbaLocationLeft:
-                p.setY((S60->screenHeightInPixels - height())>>1);
-                p.setX(qMax(0,scrollbarWidth+cbaRect.Width()));
-                break;
+            TRect staConTopRect = TRect();
+            AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStaconTop, staConTopRect);
+            if (staConTopRect.IsEmpty()) {
+                TRect cbaRect = TRect();
+                AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, cbaRect);
+                AknLayoutUtils::TAknCbaLocation cbaLocation = AknLayoutUtils::CbaLocation();
+                switch (cbaLocation) {
+                case AknLayoutUtils::EAknCbaLocationBottom:
+                    p.setY(S60->screenHeightInPixels - height() - cbaRect.Height());
+                    p.setX((S60->screenWidthInPixels - width()) >> 1);
+                    break;
+                case AknLayoutUtils::EAknCbaLocationRight:
+                    p.setY((S60->screenHeightInPixels - height()) >> 1);
+                    p.setX(qMax(0,S60->screenWidthInPixels - width() - scrollbarWidth - cbaRect.Width()));
+                    break;
+                case AknLayoutUtils::EAknCbaLocationLeft:
+                    p.setY((S60->screenHeightInPixels - height()) >> 1);
+                    p.setX(qMax(0,scrollbarWidth + cbaRect.Width()));
+                    break;
+                }
+            } else {
+                p.setY((S60->screenHeightInPixels - height()) >> 1);
+                p.setX(qMax(0,S60->screenWidthInPixels - width()));
             }
         }
         move(p);