forked from qt-creator/qt-creator
Flat and themeable side bar icons
This patch adds flat side bar icons according to http://blog.qt.io/blog/author/didesous/ The flat icons are supposed to be opt-in, via the theme flag "FlatSideBarIcons=true". It is false by default for the default theme for now. Change-Id: I1cbe69d4e138d5d23c0172a374933ac7a4ce8a5b Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
This commit is contained in:
@@ -342,7 +342,9 @@ void FancyTabBar::paintTab(QPainter *painter, int tabIndex) const
|
||||
if (drawIcon) {
|
||||
int textHeight = painter->fontMetrics().boundingRect(QRect(0, 0, width(), height()), Qt::TextWordWrap, tabText).height();
|
||||
tabIconRect.adjust(0, 4, 0, -textHeight);
|
||||
StyleHelper::drawIconWithShadow(tabIcon(tabIndex), tabIconRect, painter, enabled ? QIcon::Normal : QIcon::Disabled);
|
||||
const QIcon::Mode iconMode = enabled ? (selected ? QIcon::Active : QIcon::Normal)
|
||||
: QIcon::Disabled;
|
||||
StyleHelper::drawIconWithShadow(tabIcon(tabIndex), tabIconRect, painter, iconMode);
|
||||
}
|
||||
|
||||
painter->setOpacity(1.0); //FIXME: was 0.7 before?
|
||||
|
||||
Reference in New Issue
Block a user