summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorSami Merilä <sami.merila@nokia.com>2009-10-30 13:43:40 +0200
committerSami Merilä <sami.merila@nokia.com>2009-10-30 13:43:40 +0200
commit180e36e586437ffb751166f0088329ecbec3001e (patch)
treef68ab243c1642de1373e44eec6731bace4f597f1 /src/gui
parentda9880eaed0d09338717db1a73db01e6b0ab080d (diff)
S60Style: List items should be taller for touch use (5th Edition)
This fixes private JIRA issue: QT-1479. The change makes itemview items taller by twice the QStyle::PM_FocusFrameVMargin amount (both margins) when touch is in use. It is rather curious that the QCommonStyle modifies QRect for itemviews in horizontal direction by twice the QStyle::PM_FocusFrameHMargin amount, but does not do it in vertical direction. Task-number: QT-1479 (private) Reviewed-by: Alessandro Portale
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/styles/qs60style.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index b87f3a87a1..dc38397a3c 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -2266,10 +2266,19 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
sz += QSize(2*f->lineWidth, 4*f->lineWidth);
break;
case CT_TabBarTab:
- QSize naviPaneSize = QS60StylePrivate::naviPaneSize();
+ {
+ const QSize naviPaneSize = QS60StylePrivate::naviPaneSize();
+ sz = QCommonStyle::sizeFromContents(ct, opt, csz, widget);
+ if (naviPaneSize.height() > sz.height())
+ sz.setHeight(naviPaneSize.height());
+ }
+ break;
+ case CT_ItemViewItem:
sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
- if (naviPaneSize.height() > sz.height())
- sz.setHeight(naviPaneSize.height());
+ if (QS60StylePrivate::isTouchSupported())
+ //Make itemview easier to use in touch devices
+ //QCommonStyle does not adjust height with horizontal margin, it only adjusts width
+ sz.setHeight(sz.height() + 2*pixelMetric(QStyle::PM_FocusFrameVMargin));
break;
default:
sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);