From 2dab6c554a53c14f58b598ef062c7592821de405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 15 May 2009 13:56:31 +0300 Subject: S60Style: Make pressed down state of tool button clearer to see. --- src/gui/styles/qs60style.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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(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; -- cgit v0.12