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