summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSami Merilä <sami.merila@nokia.com>2009-11-04 16:26:01 (GMT)
committerSami Merilä <sami.merila@nokia.com>2009-11-04 16:26:01 (GMT)
commita314ed575a6d32ef2f31e9b5fd12b14f13208d4f (patch)
tree94adbe41c300012cb5014d104d7fe0abf7b11ab5 /src
parentb4ef8b906c88e5d60e687d9018af93de0e735e0c (diff)
downloadQt-a314ed575a6d32ef2f31e9b5fd12b14f13208d4f.zip
Qt-a314ed575a6d32ef2f31e9b5fd12b14f13208d4f.tar.gz
Qt-a314ed575a6d32ef2f31e9b5fd12b14f13208d4f.tar.bz2
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 350a8e6..6c56813 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);