summaryrefslogtreecommitdiffstats
path: root/src/plugins/styles/mac
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-10-14 01:00:34 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-10-14 01:00:34 +0200
commite164d61ca8263fc4b46fdd916e1ea77c7dd2b735 (patch)
tree06c50077b8baf41b756dc1aa8021c4a9ca34a9d4 /src/plugins/styles/mac
parent721a0e807881e4d00e752e3c3cf62427eb681dd2 (diff)
parent8d8140dffa9aa680a519b501fc5bdf08c91dd735 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'src/plugins/styles/mac')
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
index 481c0cd94f..7fa330beab 100644
--- a/src/plugins/styles/mac/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -328,6 +328,20 @@ static const int closeButtonSize = 14;
static const qreal closeButtonCornerRadius = 2.0;
#endif // QT_CONFIG(tabbar)
+#ifndef QT_NO_ACCESSIBILITY // This ifdef to avoid "unused function" warning.
+QBrush brushForToolButton(bool isOnKeyWindow)
+{
+ // When a toolbutton in a toolbar is in the 'ON' state, we draw a
+ // partially transparent background. The colors must be different
+ // for 'Aqua' and 'DarkAqua' appearances though.
+ if (isDarkMode())
+ return isOnKeyWindow ? QColor(73, 73, 73, 100) : QColor(56, 56, 56, 100);
+
+ return isOnKeyWindow ? QColor(0, 0, 0, 28) : QColor(0, 0, 0, 21);
+}
+#endif // QT_NO_ACCESSIBILITY
+
+
static const int headerSectionArrowHeight = 6;
static const int headerSectionSeparatorInset = 2;
@@ -5603,8 +5617,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
if (view)
isKey = [view.window isKeyWindow];
- QBrush brush(isKey ? QColor(0, 0, 0, 28)
- : QColor(0, 0, 0, 21));
+ QBrush brush(brushForToolButton(isKey));
QPainterPath path;
path.addRoundedRect(QRectF(tb->rect.x(), tb->rect.y(), tb->rect.width(), tb->rect.height() + 4), 4, 4);
p->setRenderHint(QPainter::Antialiasing);