From 97d3f5aaccf3a9efa40682fc4958b388b8be99d1 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 28 Apr 2009 13:00:32 +0200 Subject: Made tabbar tab icons set the On state for selected tabs This makes it possible to make a custom icon for the selected tab. We cannot use the Selected state because that has a blue tint on many platforms which is not what you typically want int a tab. The On state will only affect icons where these states are explicitly set. Task-number: 202063 Reviewed-by: ogoffart --- src/gui/styles/qcommonstyle.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index be80d37..f8ae1a6 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -2019,7 +2019,9 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, : QIcon::Disabled); QPixmap tabIcon = tabV2.icon.pixmap(iconSize, (tabV2.state & State_Enabled) ? QIcon::Normal - : QIcon::Disabled); + : QIcon::Disabled, + (tabV2.state & State_Selected) ? QIcon::On + : QIcon::Off); int offset = 6; int left = opt->rect.left(); -- cgit v0.12