From a314ed575a6d32ef2f31e9b5fd12b14f13208d4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Wed, 4 Nov 2009 18:26:01 +0200 Subject: 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 --- src/gui/styles/qs60style.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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(widget))) if (buttonWidget->isCheckable()) sz += QSize(pixelMetric(PM_IndicatorWidth) + pixelMetric(PM_CheckBoxLabelSpacing), 0); -- cgit v0.12