Utils: Make the "shadow" under toolbar icons optional

In preparation od a "Flat Light" theme, where shadows under the icons
would have a negative impact.

Change-Id: I2d9d3563c90336640513c1a970a432898dd63cfc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
This commit is contained in:
Alessandro Portale
2016-06-17 18:52:24 +02:00
committed by Alessandro Portale
parent 5ff15e89f2
commit abb63602de
6 changed files with 9 additions and 4 deletions

View File

@@ -315,7 +315,8 @@ void StyleHelper::drawArrow(QStyle::PrimitiveElement element, QPainter *painter,
if (!enabled) {
drawCommonStyleArrow(image.rect(), creatorTheme()->color(Theme::IconsDisabledColor));
} else {
drawCommonStyleArrow(image.rect().translated(0, devicePixelRatio), toolBarDropShadowColor());
if (creatorTheme()->flag(Theme::ToolBarIconShadow))
drawCommonStyleArrow(image.rect().translated(0, devicePixelRatio), toolBarDropShadowColor());
drawCommonStyleArrow(image.rect(), creatorTheme()->color(Theme::IconsBaseColor));
}
painter.end();
@@ -393,7 +394,7 @@ void StyleHelper::drawIconWithShadow(const QIcon &icon, const QRect &rect,
const bool hasDisabledState = icon.availableSizes(QIcon::Disabled).contains(px.size());
if (!hasDisabledState)
px = disabledSideBarIcon(icon.pixmap(window, rect.size()));
} else {
} else if (creatorTheme()->flag(Theme::ToolBarIconShadow)) {
// Draw shadow
QImage tmp(px.size() + QSize(radius * 2, radius * 2 + 1), QImage::Format_ARGB32_Premultiplied);
tmp.fill(Qt::transparent);