summaryrefslogtreecommitdiffstats
path: root/util/s60pixelmetrics/pixel_metrics.cpp
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 /util/s60pixelmetrics/pixel_metrics.cpp
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
Diffstat (limited to 'util/s60pixelmetrics/pixel_metrics.cpp')
-rw-r--r--util/s60pixelmetrics/pixel_metrics.cpp21
1 files changed, 14 insertions, 7 deletions
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;