From b75969e3fed1d1114da078df13d320342c5fab8a Mon Sep 17 00:00:00 2001 From: Cyrille Bollu Date: Thu, 19 May 2016 15:51:46 +0200 Subject: [PATCH] TabWidget - Artwork tabs: Do not change the icon color when it is highlighted --- src/gui/widgets/TabWidget.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/gui/widgets/TabWidget.cpp b/src/gui/widgets/TabWidget.cpp index bb02d3a29..a4f02f184 100644 --- a/src/gui/widgets/TabWidget.cpp +++ b/src/gui/widgets/TabWidget.cpp @@ -27,7 +27,6 @@ #include #include -#include #include #include #include @@ -253,18 +252,17 @@ void TabWidget::paintEvent( QPaintEvent * pe ) // Fixes tab's width, because original size is only correct for text tabs ( *it ).nwidth = tab_width; - // Get active or inactive artwork - QPixmap *artwork; + // Get artwork + QPixmap artwork( embed::getIconPixmap( ( *it ).inactivePixmap ) ); + + // Highlight active tab if( it.key() == m_activeTab ) { - artwork = new QPixmap( embed::getIconPixmap( ( *it ).activePixmap ) ); p.fillRect( tab_x_offset, 0, ( *it ).nwidth, m_tabbarHeight - 1, tabSelected() ); - } else { - artwork = new QPixmap( embed::getIconPixmap( ( *it ).inactivePixmap ) ); } // Draw artwork - p.drawPixmap(tab_x_offset + ( ( *it ).nwidth - ( *artwork ).width() ) / 2, 1, *artwork ); + p.drawPixmap(tab_x_offset + ( ( *it ).nwidth - artwork.width() ) / 2, 1, artwork ); } else { // Highlight tab when active