summaryrefslogtreecommitdiffstats
path: root/src/gui/styles/qs60style.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2011-03-24 16:18:52 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2011-03-24 16:18:52 (GMT)
commitf09b8e7b134c8dfe7e50d64662e943273d721d9a (patch)
tree19b13cbe46a5c676327c3b4098e527f465469523 /src/gui/styles/qs60style.cpp
parent295fbcba490712fe6e6f61926836920366134b55 (diff)
parent660f881f04a0880c83a0b43b4f4d0e89da082d92 (diff)
downloadQt-f09b8e7b134c8dfe7e50d64662e943273d721d9a.zip
Qt-f09b8e7b134c8dfe7e50d64662e943273d721d9a.tar.gz
Qt-f09b8e7b134c8dfe7e50d64662e943273d721d9a.tar.bz2
Merge remote-tracking branch 'origin/4.7' into qt-master-from-4.7
Conflicts: src/opengl/qwindowsurface_gl.cpp
Diffstat (limited to 'src/gui/styles/qs60style.cpp')
-rw-r--r--src/gui/styles/qs60style.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 7a89478..ac897b5 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -3353,9 +3353,9 @@ bool QS60Style::event(QEvent *e)
QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon,
const QStyleOption *option, const QWidget *widget) const
{
- const int iconDimension = QS60StylePrivate::pixelMetric(PM_ToolBarIconSize);
- const QRect iconSize = (!option) ? QRect(0, 0, iconDimension, iconDimension) : option->rect;
QS60StyleEnums::SkinParts part;
+ qreal iconHeightMultiplier = 1.0;
+ qreal iconWidthMultiplier = 1.0;
QS60StylePrivate::SkinElementFlags adjustedFlags;
if (option)
adjustedFlags = (option->state & State_Enabled || option->state == 0) ?
@@ -3364,15 +3364,20 @@ QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon,
switch(standardIcon) {
case SP_MessageBoxWarning:
+ // By default, S60 messagebox icons have 4:3 ratio. Value is from S60 LAF documentation.
+ iconHeightMultiplier = 1.33;
part = QS60StyleEnums::SP_QgnNoteWarning;
break;
case SP_MessageBoxInformation:
+ iconHeightMultiplier = 1.33;
part = QS60StyleEnums::SP_QgnNoteInfo;
break;
case SP_MessageBoxCritical:
+ iconHeightMultiplier = 1.33;
part = QS60StyleEnums::SP_QgnNoteError;
break;
case SP_MessageBoxQuestion:
+ iconHeightMultiplier = 1.33;
part = QS60StyleEnums::SP_QgnNoteQuery;
break;
case SP_ArrowRight:
@@ -3427,11 +3432,13 @@ QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon,
adjustedFlags |= QS60StylePrivate::SF_PointEast;
part = QS60StyleEnums::SP_QgnIndiSubmenu;
break;
-
default:
return QCommonStyle::standardIconImplementation(standardIcon, option, widget);
}
const QS60StylePrivate::SkinElementFlags flags = adjustedFlags;
+ const int iconDimension = QS60StylePrivate::pixelMetric(PM_ToolBarIconSize);
+ const QRect iconSize = (!option) ?
+ QRect(0, 0, iconDimension * iconWidthMultiplier, iconDimension * iconHeightMultiplier) : option->rect;
const QPixmap cachedPixMap(QS60StylePrivate::cachedPart(part, iconSize.size(), 0, flags));
return cachedPixMap.isNull() ?
QCommonStyle::standardIconImplementation(standardIcon, option, widget) : QIcon(cachedPixMap);