src/gui/dialogs/qdialog.cpp
changeset 22 79de32ba3296
parent 19 fcece45ef507
child 30 5dc02b23752f
equal deleted inserted replaced
19:fcece45ef507 22:79de32ba3296
   902             if (!bgContainer) {
   902             if (!bgContainer) {
   903                 cbaHeight = 0;
   903                 cbaHeight = 0;
   904             } else {
   904             } else {
   905                 cbaHeight = qt_TSize2QSize(bgContainer->Size()).height();
   905                 cbaHeight = qt_TSize2QSize(bgContainer->Size()).height();
   906             }
   906             }
   907             p.setY(S60->screenHeightInPixels-height()-cbaHeight);
   907             p.setY(S60->screenHeightInPixels - height() - cbaHeight);
   908             p.setX(0);
   908             p.setX(0);
   909         } else {
   909         } else {
   910             const int scrollbarWidth = style()->pixelMetric(QStyle::PM_ScrollBarExtent);
   910             const int scrollbarWidth = style()->pixelMetric(QStyle::PM_ScrollBarExtent);
   911             TRect cbaRect = TRect();
   911             TRect staConTopRect = TRect();
   912             AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, cbaRect);
   912             AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStaconTop, staConTopRect);
   913             AknLayoutUtils::TAknCbaLocation cbaLocation = AknLayoutUtils::CbaLocation();
   913             if (staConTopRect.IsEmpty()) {
   914             switch (cbaLocation) {
   914                 TRect cbaRect = TRect();
   915             case AknLayoutUtils::EAknCbaLocationBottom:
   915                 AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, cbaRect);
   916                 p.setY(S60->screenHeightInPixels - height()-cbaRect.Height());
   916                 AknLayoutUtils::TAknCbaLocation cbaLocation = AknLayoutUtils::CbaLocation();
   917                 p.setX((S60->screenWidthInPixels - width())>>1);
   917                 switch (cbaLocation) {
   918                 break;
   918                 case AknLayoutUtils::EAknCbaLocationBottom:
   919             case AknLayoutUtils::EAknCbaLocationRight:
   919                     p.setY(S60->screenHeightInPixels - height() - cbaRect.Height());
   920                 p.setY((S60->screenHeightInPixels - height())>>1);
   920                     p.setX((S60->screenWidthInPixels - width()) >> 1);
   921                 p.setX(qMax(0,S60->screenWidthInPixels-width()-scrollbarWidth-cbaRect.Width()));
   921                     break;
   922                 break;
   922                 case AknLayoutUtils::EAknCbaLocationRight:
   923             case AknLayoutUtils::EAknCbaLocationLeft:
   923                     p.setY((S60->screenHeightInPixels - height()) >> 1);
   924                 p.setY((S60->screenHeightInPixels - height())>>1);
   924                     p.setX(qMax(0,S60->screenWidthInPixels - width() - scrollbarWidth - cbaRect.Width()));
   925                 p.setX(qMax(0,scrollbarWidth+cbaRect.Width()));
   925                     break;
   926                 break;
   926                 case AknLayoutUtils::EAknCbaLocationLeft:
       
   927                     p.setY((S60->screenHeightInPixels - height()) >> 1);
       
   928                     p.setX(qMax(0,scrollbarWidth + cbaRect.Width()));
       
   929                     break;
       
   930                 }
       
   931             } else {
       
   932                 p.setY((S60->screenHeightInPixels - height()) >> 1);
       
   933                 p.setX(qMax(0,S60->screenWidthInPixels - width()));
   927             }
   934             }
   928         }
   935         }
   929         move(p);
   936         move(p);
   930     }
   937     }
   931     return doS60Positioning;
   938     return doS60Positioning;