Windows: Fix submenu arrow style

Since dccf5a5ae7 the submenus have the
parent menu as an actual parent widget. That makes ManhattanStyle handle
them differently, because they are now children of the menu bar, and
therefore considered "panel widgets" to be styled.

An undesired side-effect is that ManhattanStyle decides to style the
submenu arrows itself then.

The patch makes ManhattanStyle not style arrows if they are painted as
part of a menu.

Fixes: QTCREATORBUG-21376
Change-Id: Ia5556c7327c3f0c2f21cadc86047bec785da27df
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
This commit is contained in:
Eike Ziller
2019-03-11 12:28:41 +01:00
parent 47d159273e
commit 8ff29ff19d

View File

@@ -608,9 +608,10 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
case PE_IndicatorArrowDown:
case PE_IndicatorArrowRight:
case PE_IndicatorArrowLeft:
{
if (qobject_cast<const QMenu *>(widget)) // leave submenu arrow painting alone
QProxyStyle::drawPrimitive(element, option, painter, widget);
else
StyleHelper::drawArrow(element, painter, option);
}
break;
default: