summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2010-05-07 12:24:34 (GMT)
committerSami Merila <sami.merila@nokia.com>2010-05-07 12:24:34 (GMT)
commita671c8442d1024e6fd842c05b35ad682a48de76d (patch)
tree67fd8df9951116cc967d57eacf1cdf30b7203d43 /src
parent0b56799601690a747c42dfbbefe95f18e837eb3f (diff)
downloadQt-a671c8442d1024e6fd842c05b35ad682a48de76d.zip
Qt-a671c8442d1024e6fd842c05b35ad682a48de76d.tar.gz
Qt-a671c8442d1024e6fd842c05b35ad682a48de76d.tar.bz2
QS60Style: When context menu is open ToolButton is not pressed down
QS60Style prefers to use widget and calls its down() API. The value is not true unless tool button has been set down programmatically. Thus, we should rely on State_Sunken as well. As a fix, style asks from both the widget and checks the state before drawing button raised/pressed. Task-number: QTBUG-10487 Reviewed-by: Alessandro Portale
Diffstat (limited to 'src')
-rw-r--r--src/gui/styles/qs60style.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index a0e8496..326335a 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -1121,11 +1121,9 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
tool.rect = button.unite(menuRect);
tool.state = bflags;
const QToolButton *toolButtonWidget = qobject_cast<const QToolButton *>(widget);
- QS60StylePrivate::SkinElements element;
- if (toolButtonWidget)
- element = (toolButtonWidget->isDown()) ? QS60StylePrivate::SE_ToolBarButtonPressed : QS60StylePrivate::SE_ToolBarButton;
- else
- element = (option->state & State_Sunken) ? QS60StylePrivate::SE_ToolBarButtonPressed : QS60StylePrivate::SE_ToolBarButton;
+ const QS60StylePrivate::SkinElements element =
+ ((toolButtonWidget && toolButtonWidget->isDown()) || (option->state & State_Sunken)) ?
+ QS60StylePrivate::SE_ToolBarButtonPressed : QS60StylePrivate::SE_ToolBarButton;
QS60StylePrivate::drawSkinElement(element, painter, tool.rect, flags);
drawPrimitive(PE_PanelButtonTool, &tool, painter, widget);
}