From 039d232a13b128ae01cda0e5572edf7474983641 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Fri, 7 May 2010 15:39:58 +0300 Subject: QS60Style - PushButton with text and with icon should be of same size When pushbutton contains standardIcon or non-modified text, it should be of same size. As a fix, style now checking default text height for icon pushbuttons and if the icon is smaller than text height, style will make button to match text height content. Task-number: QT-2179 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 326335a..56d52b1 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2508,7 +2508,7 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt, sz += QSize(pixelMetric(PM_IndicatorWidth) + pixelMetric(PM_CheckBoxLabelSpacing), 0); const int iconHeight = (!buttonWidget->icon().isNull()) ? buttonWidget->iconSize().height() : 0; const int textHeight = (buttonWidget->text().length() > 0) ? - buttonWidget->fontMetrics().size(Qt::TextSingleLine, buttonWidget->text()).height() : 0; + buttonWidget->fontMetrics().size(Qt::TextSingleLine, buttonWidget->text()).height() : opt->fontMetrics.height(); const int decoratorHeight = (buttonWidget->isCheckable()) ? pixelMetric(PM_IndicatorHeight) : 0; const int contentHeight = -- cgit v0.12