summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2010-01-29 15:32:51 (GMT)
committerSami Merila <sami.merila@nokia.com>2010-01-29 15:32:51 (GMT)
commitaf8b3c9d911a7ad6722bfa587b8a2f48c4254de3 (patch)
tree77fd23cd5be79c848e7d59c5be397ad0fac6c6c6
parent4f584d5d4c53d8510a34a698fac0f78c17f6cb93 (diff)
downloadQt-af8b3c9d911a7ad6722bfa587b8a2f48c4254de3.zip
Qt-af8b3c9d911a7ad6722bfa587b8a2f48c4254de3.tar.gz
Qt-af8b3c9d911a7ad6722bfa587b8a2f48c4254de3.tar.bz2
List item margins are too small due to invalid pixel metric value
Pixel metric values for PM_FocusFrameVMargin and PM_FocusFrameHMargin were based on AVKON grid layout. Apparently, AVKON has a major difference for text margin in lists and grids. List values are almost double of what is used in the grids. Original values were poor fit for list usability, it made the text items very close to each anothre. Task-number: QTBUG-7258 Reviewed-by: Alessandro Portale
-rw-r--r--src/gui/styles/qs60style.cpp16
-rw-r--r--util/s60pixelmetrics/pixel_metrics.cpp21
2 files changed, 22 insertions, 15 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index a40a84c..fc435e8 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -92,10 +92,10 @@ static const qreal goldenRatio = 1.618;
const layoutHeader QS60StylePrivate::m_layoutHeaders[] = {
// *** generated layout data ***
-{240,320,1,15,"QVGA Landscape"},
-{320,240,1,15,"QVGA Portrait"},
-{360,640,1,15,"NHD Landscape"},
-{640,360,1,15,"NHD Portrait"},
+{240,320,1,16,"QVGA Landscape"},
+{320,240,1,16,"QVGA Portrait"},
+{360,640,1,16,"NHD Landscape"},
+{640,360,1,16,"NHD Portrait"},
{352,800,1,12,"E90 Landscape"}
// *** End of generated data ***
};
@@ -104,10 +104,10 @@ const int QS60StylePrivate::m_numberOfLayouts =
const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = {
// *** generated pixel metrics ***
-{5,0,-909,0,0,2,0,0,-1,7,12,19,13,13,6,200,-909,-909,-909,20,13,2,0,0,21,7,18,-909,3,3,1,-909,-909,0,1,0,0,12,20,15,15,18,18,1,115,18,0,-909,-909,-909,-909,0,0,16,2,-909,0,0,-909,16,-909,-909,-909,-909,32,18,55,24,55,3,3,4,9,13,-909,5,51,11,5,0,3,3,6,8,3,3,-909,2,-909,-909,-909,-909,5,5,3,1},
-{5,0,-909,0,0,1,0,0,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,8,27,-909,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,4,4,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,2,-909,-909,-909,-909,6,6,3,1},
-{7,0,-909,0,0,2,0,0,-1,25,69,28,19,19,9,258,-909,-909,-909,23,19,26,0,0,32,25,72,-909,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,5,5,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1},
-{7,0,-909,0,0,2,0,0,-1,25,68,28,19,19,9,258,-909,-909,-909,31,19,6,0,0,32,25,60,-909,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,5,5,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1},
+{5,0,-909,0,0,2,0,0,-1,7,12,19,13,13,6,200,-909,-909,-909,20,13,2,0,0,21,7,18,-909,3,3,1,-909,-909,0,1,0,0,12,20,15,15,18,18,1,115,18,0,-909,-909,-909,-909,0,0,16,2,-909,0,0,-909,16,-909,-909,-909,-909,32,18,55,24,55,4,4,4,9,13,-909,5,51,11,5,0,3,3,6,8,3,3,-909,2,-909,-909,-909,-909,5,5,3,1},
+{5,0,-909,0,0,1,0,0,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,8,27,-909,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,3,3,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,2,-909,-909,-909,-909,6,6,3,1},
+{7,0,-909,0,0,2,0,0,-1,25,69,28,19,19,9,258,-909,-909,-909,23,19,26,0,0,32,25,72,-909,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,13,13,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1},
+{7,0,-909,0,0,2,0,0,-1,25,68,28,19,19,9,258,-909,-909,-909,31,19,6,0,0,32,25,60,-909,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,12,12,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1},
{7,0,-909,0,0,2,0,0,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,7,32,-909,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1}
// *** End of generated data ***
};
diff --git a/util/s60pixelmetrics/pixel_metrics.cpp b/util/s60pixelmetrics/pixel_metrics.cpp
index 705c0ec..93873fb 100644
--- a/util/s60pixelmetrics/pixel_metrics.cpp
+++ b/util/s60pixelmetrics/pixel_metrics.cpp
@@ -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 @@ TInt PixelMetrics::PixelMetricValue(QStyle::PixelMetric metric)
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;