diff options
author | Sami Merila <sami.merila@nokia.com> | 2010-03-30 12:40:36 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2010-03-30 12:40:36 (GMT) |
commit | 601b68cbff1d0fc3f718d658384e75fce189381a (patch) | |
tree | 453c8fcc47dde7b939d7450a87eb523d08a7caf7 /src | |
parent | 0996c6787e7b5fd9254cf2558ec0f8a892a482cf (diff) | |
download | Qt-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
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/styles/qs60style.cpp | 2 |
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; |