summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2010-03-30 12:40:36 (GMT)
committerSami Merila <sami.merila@nokia.com>2010-03-30 12:40:36 (GMT)
commit601b68cbff1d0fc3f718d658384e75fce189381a (patch)
tree453c8fcc47dde7b939d7450a87eb523d08a7caf7
parent0996c6787e7b5fd9254cf2558ec0f8a892a482cf (diff)
downloadQt-601b68cbff1d0fc3f718d658384e75fce189381a.zip
Qt-601b68cbff1d0fc3f718d658384e75fce189381a.tar.gz
Qt-601b68cbff1d0fc3f718d658384e75fce189381a.tar.bz2
QS60Style: Custom QPushButton: Heigth is calculated wrongly
If button contains a layout with widgets instead of having direct label and icon, QS60Style calculates the size of the content incorrectly. This is regression for a fix to QTBUG-7586. Now style ignores orginal size of pushbutton and tries to calculate correct height by itself. Issue is fixed by selecting teh bigger of orginal height and calculated height. Task-number: QT-3197 Reviewed-by: Alessandro Portale
-rw-r--r--src/gui/styles/qs60style.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 000696c..f49acc4 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -2433,7 +2433,7 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
const int contentHeight =
qMax(qMax(iconHeight, decoratorHeight) + pixelMetric(PM_ButtonMargin),
textHeight + 2*pixelMetric(PM_ButtonMargin));
- sz.setHeight(contentHeight);
+ sz.setHeight(qMax(sz.height(), contentHeight));
sz += QSize(2 * pixelMetric(PM_ButtonMargin), 0);
}
break;