From 3e1c7f6fd58ad6ac93a5a3c5334c834512be2eb0 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Sat, 2 Apr 2016 20:24:00 +0200 Subject: [PATCH] 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 --- src/plugins/coreplugin/manhattanstyle.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index e25346785db..0c5cd6c39be 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -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()) {