util/s60pixelmetrics/pixel_metrics.cpp
branchRCL_3
changeset 5 d3bac044e0f0
parent 4 3b1da2848fc7
child 7 3f74d0d4af4c
--- a/util/s60pixelmetrics/pixel_metrics.cpp	Fri Feb 19 23:40:16 2010 +0200
+++ b/util/s60pixelmetrics/pixel_metrics.cpp	Fri Mar 12 15:46:37 2010 +0200
@@ -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 = 16;
 
 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;