util/s60pixelmetrics/pixel_metrics.cpp
changeset 7 f7bc934e204c
parent 3 41300fa6a67c
--- a/util/s60pixelmetrics/pixel_metrics.cpp	Tue Feb 02 00:43:10 2010 +0200
+++ b/util/s60pixelmetrics/pixel_metrics.cpp	Wed Mar 31 11:06:36 2010 +0300
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
@@ -50,7 +50,7 @@
 // so that we can keep dynamic and static values inline.
 // Please adjust version data if correcting dynamic PM calculations.
 const TInt KPMMajorVersion = 1;
-const TInt KPMMinorVersion = 15;
+const TInt KPMMinorVersion = 17;
 
 TPixelMetricsVersion PixelMetrics::Version()
     {
@@ -855,19 +855,26 @@
         case QStyle::PM_FocusFrameHMargin:
         case QStyle::PM_FocusFrameVMargin:
             {
-            TAknLayoutRect gridRect;
-            gridRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::grid_highlight_pane(0));
-            TAknLayoutRect gridRectCenter;
-            gridRectCenter.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::cell_highlight_pane_g1());
+            TAknLayoutRect listScrollPane;
+            listScrollPane.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::listscroll_gen_pane(0));
+            TAknLayoutRect listGenPane;
+            listGenPane.LayoutRect(listScrollPane.Rect(), AknLayoutScalable_Avkon::list_gen_pane(0));
+            TAknLayoutRect listSinglePane;
+            listSinglePane.LayoutRect(listGenPane.Rect(), AknLayoutScalable_Avkon::list_single_pane(0));
+            TAknLayoutText listSinglePaneText;
+            listSinglePaneText.LayoutText(listSinglePane.Rect(), AknLayoutScalable_Avkon::list_single_pane_t1(0));
+            TAknLayoutRect highlightRect;
+            highlightRect.LayoutRect(listSinglePane.Rect(), AknLayoutScalable_Avkon::list_highlight_pane_cp1().LayoutLine());
 
             // The difference of center piece from border tell the frame width.
             if ( value == QStyle::PM_FocusFrameHMargin)
                 {
-                value = gridRect.Rect().iBr.iX - gridRectCenter.Rect().iBr.iX;
+                 //use topleft for horizontal as S60 uses different values for right and left borders
+                 value = listSinglePaneText.TextRect().iTl.iX - highlightRect.Rect().iTl.iX;
                 }
             else
                 {
-                value = gridRect.Rect().iBr.iY - gridRectCenter.Rect().iBr.iY;
+                 value = highlightRect.Rect().iBr.iY - listSinglePaneText.TextRect().iBr.iY;
                 }
             }
             break;
@@ -996,6 +1003,13 @@
         case QStyle::PM_Custom_ThinLineWidth:
             value = 1;
             break;
+        case QStyle::PM_Custom_MessageBoxHeight:
+            {
+            TAknLayoutRect popupRect;
+            popupRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::popup_window_general(0));
+            value = popupRect.Rect().Height();
+            }
+            break;
         case QStyle::PM_ButtonShiftHorizontal:
         case QStyle::PM_ButtonShiftVertical:
             value = 0;
@@ -1005,12 +1019,15 @@
             value = PixelMetricTabValue(QStyle::PM_TabBarScrollButtonWidth, appWindow.Rect(), landscape);
             break;
 
+        case QStyle::PM_MenuScrollerHeight:
+            value = 0;
+            break;
+
 // todo: re-check if these really are not available in s60
         case QStyle::PM_MenuDesktopFrameWidth:    // not needed in S60 - dislocates Menu both horizontally and vertically
         case QStyle::PM_HeaderMarkSize:           // The size of the sort indicator in a header. Not in S60
         case QStyle::PM_SpinBoxSliderHeight:       // The height of the optional spin box slider. Not in S60
         case QStyle::PM_HeaderMargin: // not in S60
-        case QStyle::PM_MenuScrollerHeight: // not in S60
         case QStyle::PM_MenuTearoffHeight: // not in S60
         case QStyle::PM_DockWidgetFrameWidth: // not in S60
         case QStyle::PM_DockWidgetSeparatorExtent: // not in S60