summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSami Merilä <sami.merila@nokia.com>2009-11-04 18:26:01 +0200
committerSami Merilä <sami.merila@nokia.com>2009-11-04 18:26:01 +0200
commita314ed575a6d32ef2f31e9b5fd12b14f13208d4f (patch)
tree94adbe41c300012cb5014d104d7fe0abf7b11ab5 /src
parentb4ef8b906c88e5d60e687d9018af93de0e735e0c (diff)
Make button margins bigger in QS60Style
Currenly QS60Style relies on QCommonStyle to calculate correct button content size. Unfortunately, common style does not understand frames, so it is possible that the frame-border of theme graphic gets under button content. This change makes both QPushButton and QToolButton bigger. Task-number: None Reviewed-by: Alessandro Portale
Diffstat (limited to 'src')
-rw-r--r--src/gui/styles/qs60style.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 350a8e6868..6c568138d0 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -2292,8 +2292,15 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
{
QSize sz(csz);
switch (ct) {
+ case CT_ToolButton:
+ sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
+ //FIXME properly - style should calculate the location of border frame-part
+ sz += QSize(2*pixelMetric(PM_ButtonMargin), 2*pixelMetric(PM_ButtonMargin));
+ break;
case CT_PushButton:
sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
+ //FIXME properly - style should calculate the location of border frame-part
+ sz += QSize(2*pixelMetric(PM_ButtonMargin), 2*pixelMetric(PM_ButtonMargin));
if (const QAbstractButton *buttonWidget = (qobject_cast<const QAbstractButton *>(widget)))
if (buttonWidget->isCheckable())
sz += QSize(pixelMetric(PM_IndicatorWidth) + pixelMetric(PM_CheckBoxLabelSpacing), 0);