From 0b6478d1105a5a7747aad418aa69e5b14d8b8065 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Sat, 3 May 2014 11:40:14 +0200 Subject: [PATCH] [ComboTabBar] Use initStyleOption workaround only for Bespin theme It is needed only with Bespin. With other themes, it actually makes it worse. --- src/lib/tabwidget/combotabbar.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib/tabwidget/combotabbar.cpp b/src/lib/tabwidget/combotabbar.cpp index f07a90884..62b94d81f 100644 --- a/src/lib/tabwidget/combotabbar.cpp +++ b/src/lib/tabwidget/combotabbar.cpp @@ -1211,6 +1211,15 @@ void TabBarHelper::initStyleOption(QStyleOptionTab* option, int tabIndex) const { QTabBar::initStyleOption(option, tabIndex); + // Bespin doesn't highlight current tab when there is only one tab in tabbar + static int isBespin = -1; + + if (isBespin == -1) + isBespin = mApp->styleName() == QL1S("bespin"); + + if (!isBespin) + return; + int index = m_isPinnedTabBar ? tabIndex : m_comboTabBar->pinnedTabsCount() + tabIndex; if (m_comboTabBar->count() > 1) {