diff --git a/share/qtcreator/themes/dark.creatortheme b/share/qtcreator/themes/dark.creatortheme index 80944848444..e538150cd1a 100644 --- a/share/qtcreator/themes/dark.creatortheme +++ b/share/qtcreator/themes/dark.creatortheme @@ -188,6 +188,7 @@ ApplyThemePaletteGlobally=true FlatSideBarIcons=true FlatProjectsMode=true FlatMenuBar=true +ToolBarIconShadow=true [Gradients] DetailsWidgetHeaderGradient\1\color=0 diff --git a/share/qtcreator/themes/default.creatortheme b/share/qtcreator/themes/default.creatortheme index 366b8be8c8e..441326bb614 100644 --- a/share/qtcreator/themes/default.creatortheme +++ b/share/qtcreator/themes/default.creatortheme @@ -182,6 +182,7 @@ ApplyThemePaletteGlobally=false FlatSideBarIcons=false FlatProjectsMode=false FlatMenuBar=false +ToolBarIconShadow=true [Gradients] DetailsWidgetHeaderGradient\1\color=ffffff diff --git a/share/qtcreator/themes/flat.creatortheme b/share/qtcreator/themes/flat.creatortheme index 48661f6e099..0ba0b6fc18e 100644 --- a/share/qtcreator/themes/flat.creatortheme +++ b/share/qtcreator/themes/flat.creatortheme @@ -192,6 +192,7 @@ ApplyThemePaletteGlobally=false FlatSideBarIcons=true FlatProjectsMode=false FlatMenuBar=false +ToolBarIconShadow=true [Gradients] DetailsWidgetHeaderGradient\1\color=0 diff --git a/src/libs/utils/icon.cpp b/src/libs/utils/icon.cpp index 138a3ddbd9d..fbfb1e25f16 100644 --- a/src/libs/utils/icon.cpp +++ b/src/libs/utils/icon.cpp @@ -129,7 +129,7 @@ static QPixmap masksToIcon(const MasksAndColors &masks, const QPixmap &combinedM p.drawPixmap(0, 0, maskToColorAndAlpha((*maskImage).first, (*maskImage).second)); } - if (style & Icon::DropShadow) { + if (style & Icon::DropShadow && creatorTheme()->flag(Theme::ToolBarIconShadow)) { const QPixmap shadowMask = maskToColorAndAlpha(combinedMask, Qt::black); p.setCompositionMode(QPainter::CompositionMode_DestinationOver); p.setOpacity(0.05); 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); diff --git a/src/libs/utils/theme/theme.h b/src/libs/utils/theme/theme.h index 91b4b14847c..b7e3ea6a444 100644 --- a/src/libs/utils/theme/theme.h +++ b/src/libs/utils/theme/theme.h @@ -274,7 +274,8 @@ public: ApplyThemePaletteGlobally, FlatSideBarIcons, FlatProjectsMode, - FlatMenuBar + FlatMenuBar, + ToolBarIconShadow }; enum WidgetStyle {