summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSami Merilä <sami.merila@nokia.com>2009-05-15 10:56:31 (GMT)
committerSami Merilä <sami.merila@nokia.com>2009-05-15 10:56:31 (GMT)
commit2dab6c554a53c14f58b598ef062c7592821de405 (patch)
treee9b49221aacd87d6b82b5acccae471e6f0a20958 /src
parent631467df8481ac1cba5d8c263888fa368b854111 (diff)
downloadQt-2dab6c554a53c14f58b598ef062c7592821de405.zip
Qt-2dab6c554a53c14f58b598ef062c7592821de405.tar.gz
Qt-2dab6c554a53c14f58b598ef062c7592821de405.tar.bz2
S60Style: Make pressed down state of tool button clearer to see.
Diffstat (limited to 'src')
-rw-r--r--src/gui/styles/qs60style.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 6f4472c..5be7fe8 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -1229,6 +1229,16 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
case CE_ToolButtonLabel:
if (const QStyleOptionToolButton *toolBtn = qstyleoption_cast<const QStyleOptionToolButton *>(option)) {
QStyleOptionToolButton optionToolButton = *toolBtn;
+
+ if (!optionToolButton.icon.isNull() && (optionToolButton.state & QStyle::State_Sunken)
+ && (optionToolButton.state & State_Enabled)) {
+
+ const QIcon::State state = optionToolButton.state & State_On ? QIcon::On : QIcon::Off;
+ const QPixmap pm(optionToolButton.icon.pixmap(optionToolButton.rect.size().boundedTo(optionToolButton.iconSize),
+ QIcon::Normal, state));
+ optionToolButton.icon = generatedIconPixmap(QIcon::Selected, pm, &optionToolButton);
+ }
+
QCommonStyle::drawControl(element, &optionToolButton, painter, widget);
}
break;