Flat themes: remove the shadow from pressed manhattan toolbuttons

That's flatter and more consistent with the flat pressed buttons in the
mode bar and status bar.

Change-Id: I29edd2b184b8468005bffe8fe8c9f2e275355df1
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
This commit is contained in:
Alessandro Portale
2016-04-02 20:24:00 +02:00
parent 14af79932a
commit 3e1c7f6fd5

View File

@@ -485,15 +485,16 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
anim->paint(painter, option);
} else {
bool pressed = option->state & State_Sunken || option->state & State_On;
QColor shadow(0, 0, 0, 30);
painter->setPen(shadow);
painter->setPen(StyleHelper::sidebarShadow());
if (pressed) {
const QColor shade = creatorTheme()->color(Theme::FancyToolButtonSelectedColor);
painter->fillRect(rect, shade);
const QRectF borderRect = QRectF(rect).adjusted(0.5, 0.5, -0.5, -0.5);
painter->drawLine(borderRect.topLeft() + QPointF(1, 0), borderRect.topRight() - QPointF(1, 0));
painter->drawLine(borderRect.topLeft(), borderRect.bottomLeft());
painter->drawLine(borderRect.topRight(), borderRect.bottomRight());
if (creatorTheme()->widgetStyle() == Theme::StyleDefault) {
const QRectF borderRect = QRectF(rect).adjusted(0.5, 0.5, -0.5, -0.5);
painter->drawLine(borderRect.topLeft() + QPointF(1, 0), borderRect.topRight() - QPointF(1, 0));
painter->drawLine(borderRect.topLeft(), borderRect.bottomLeft());
painter->drawLine(borderRect.topRight(), borderRect.bottomRight());
}
} else if (option->state & State_Enabled && option->state & State_MouseOver) {
painter->fillRect(rect, creatorTheme()->color(Theme::FancyToolButtonHoverColor));
} else if (widget && widget->property("highlightWidget").toBool()) {