diff options
author | Sami Merila <sami.merila@nokia.com> | 2010-05-07 12:39:58 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2010-05-07 12:39:58 (GMT) |
commit | 039d232a13b128ae01cda0e5572edf7474983641 (patch) | |
tree | 978bc7af8b8511b963695e3da1ef7cfc5f5cc889 /src/gui/styles/qs60style.cpp | |
parent | 48c414f5f5f60aafa0c7b45bafb2b8374eb63e01 (diff) | |
download | Qt-039d232a13b128ae01cda0e5572edf7474983641.zip Qt-039d232a13b128ae01cda0e5572edf7474983641.tar.gz Qt-039d232a13b128ae01cda0e5572edf7474983641.tar.bz2 |
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
Diffstat (limited to 'src/gui/styles/qs60style.cpp')
-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 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 = |