From 601b68cbff1d0fc3f718d658384e75fce189381a Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Tue, 30 Mar 2010 15:40:36 +0300 Subject: 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 --- src/gui/styles/qs60style.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v0.12