summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2010-04-26 13:27:47 +0300
committerSami Merila <sami.merila@nokia.com>2010-04-26 13:27:47 +0300
commitec7ec74c6812398f74981d3703bf9a876b865bfe (patch)
treebbd0d9b1dbadaf782c729ed01c1490d735d0dafd /util
parentaeeb83806daaa2ddb4b6c87162c929d61cf1350c (diff)
downloadqt4-tools-ec7ec74c6812398f74981d3703bf9a876b865bfe.tar.gz
QS60Style: QMenu behaves badly with a lot of menu items
Due to recent change in QS60Style where combobox menu was changed to popup menu, instead of dropdown menu, long QMenus now work sloppily. This is due to that pixel metric PE_MenuScrollerHeight was set to zero to avoid "non-drawn" areas in combobox popups. Of course, QMenu scrolling really needs the scrolling area if it is to make any scrolling. As a solution, scroller height is now zero for combobox popup and in QMenu it is the height of itemview item (for "standard" content), but no any scroller indication is drawn. The menu scrolls automatically when bottom/top part of menu list is highlighted. Task-number: QTBUG-10073 Reviewed-by: Janne Koskinen
Diffstat (limited to 'util')
-rw-r--r--util/s60pixelmetrics/pixel_metrics.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/util/s60pixelmetrics/pixel_metrics.cpp b/util/s60pixelmetrics/pixel_metrics.cpp
index 814e185fd4..0fd650e5b6 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 = 17;
+const TInt KPMMinorVersion = 18;
TPixelMetricsVersion PixelMetrics::Version()
{
@@ -1020,7 +1020,21 @@ TInt PixelMetrics::PixelMetricValue(QStyle::PixelMetric metric)
break;
case QStyle::PM_MenuScrollerHeight:
- value = 0;
+ {
+ TRect rectParent( mainPaneRect );
+ TAknLayoutRect listWidthScrollBarsRect;
+ listWidthScrollBarsRect.LayoutRect( rectParent, AknLayoutScalable_Avkon::listscroll_gen_pane(0).LayoutLine() );
+
+ TAknLayoutRect listWidgetRect;
+ listWidgetRect.LayoutRect( listWidthScrollBarsRect.Rect(), AknLayoutScalable_Avkon::list_gen_pane(0).LayoutLine() );
+ TAknLayoutRect singleLineListWidgetRect;
+ singleLineListWidgetRect.LayoutRect( listWidgetRect.Rect(), AknLayoutScalable_Avkon::list_single_pane(0).LayoutLine() );
+
+ TAknLayoutRect listHighlightRect;
+ listHighlightRect.LayoutRect( singleLineListWidgetRect.Rect(), AknLayoutScalable_Avkon::list_highlight_pane_cp1(0).LayoutLine() );
+
+ value = listHighlightRect.Rect().Height();
+ }
break;
// todo: re-check if these really are not available in s60