diff options
author | Alessandro Portale <alessandro.portale@theqtcompany.com> | 2016-06-17 18:52:24 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2016-06-20 07:49:56 +0000 |
commit | abb63602de086547d7096b90f60393adafef43c0 (patch) | |
tree | ecaa83e0e9a770da60c1d4a20d6d60319a229720 /src/libs/utils/stylehelper.cpp | |
parent | 5ff15e89f29f7cd2f687d980e45fac84ced11097 (diff) |
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>
Diffstat (limited to 'src/libs/utils/stylehelper.cpp')
-rw-r--r-- | src/libs/utils/stylehelper.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libs/utils/stylehelper.cpp b/src/libs/utils/stylehelper.cpp index 2a07ffac6c1..3d24afb74c7 100644 --- a/src/libs/utils/stylehelper.cpp +++ b/src/libs/utils/stylehelper.cpp @@ -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); |