summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@qt.io>2017-06-23 10:47:23 -0700
committerBłażej Szczygieł <spaz16@wp.pl>2017-06-28 10:34:35 +0000
commitd138a239d27b3f2d3b654b4768f8000bb2a555a1 (patch)
tree2f18791355e23a9e38a3f39fe13b6257245b2bff /src/widgets/styles
parent9c9382a85f53756c3c702ef7a999720ae40be5b9 (diff)
Fix current tab text color on Mac when a proxy style is installed
We move the code forcing white text on the current tab to QMacStyle. This removes the small encapsulation violation even though we need to check for the tab text color in the style and modify the palette. Amends 2fbc1432025dd478cf9e940e3c2a1952b218c6dc. Change-Id: If31dc11ae389ee5315e84ab03cf1c08540d81640 Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 8d0fe1196c..cf2929db7e 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -4210,6 +4210,12 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
// outside world, unless they read the source, in which case, it's
// their own fault).
bool nonDefaultFont = p->font() != qt_app_fonts_hash()->value("QComboMenuItem");
+
+ if (!myTab.documentMode && (myTab.state & State_Selected) && (myTab.state & State_Active))
+ if (const auto *tabBar = qobject_cast<const QTabBar *>(w))
+ if (!tabBar->tabTextColor(tabBar->currentIndex()).isValid())
+ myTab.palette.setColor(QPalette::WindowText, Qt::white);
+
if (verticalTabs || nonDefaultFont || !tab->icon.isNull()
|| !myTab.leftButtonSize.isEmpty() || !myTab.rightButtonSize.isEmpty()) {
int heightOffset = 0;