VerticalTabs: Don't use selected icon mode for favicons

On some styles (particularly QStyleSheetStyle) it returns pixmap
drawn onto background color.
remotes/origin/Falkon/3.0
David Rosca 8 years ago
parent 4db34d4645
commit ca60f9a300
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8
  1. 4
      src/plugins/VerticalTabs/tablistdelegate.cpp
  2. 3
      src/plugins/VerticalTabs/tabtreedelegate.cpp

@ -56,8 +56,6 @@ void TabListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &optio
const int height = opt.rect.height();
const int center = height / 2 + opt.rect.top();
const QIcon::Mode iconMode = opt.state & QStyle::State_Selected ? QIcon::Selected : QIcon::Normal;
// Draw background
style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, w);
@ -69,7 +67,7 @@ void TabListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &optio
if (index.data(TabModel::LoadingRole).toBool()) {
pixmap = m_loadingAnimator->pixmap(index);
} else {
pixmap = index.data(Qt::DecorationRole).value<QIcon>().pixmap(iconSize, iconMode);
pixmap = index.data(Qt::DecorationRole).value<QIcon>().pixmap(iconSize);
}
painter->drawPixmap(iconRect, pixmap);

@ -159,7 +159,6 @@ void TabTreeDelegate::paint(QPainter *painter, const QStyleOptionViewItem &optio
int leftPosition = opt.rect.left() + m_indentation + m_indentation * depth + m_padding;
int rightPosition = opt.rect.right() - m_padding * 2 - m_closeButton->size().width();
const QIcon::Mode iconMode = opt.state & QStyle::State_Selected ? QIcon::Selected : QIcon::Normal;
const QPalette::ColorRole colorRole = opt.state & QStyle::State_Selected ? QPalette::HighlightedText : QPalette::Text;
QPalette::ColorGroup cg = opt.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled;
@ -202,7 +201,7 @@ void TabTreeDelegate::paint(QPainter *painter, const QStyleOptionViewItem &optio
if (index.data(TabModel::LoadingRole).toBool()) {
pixmap = m_loadingAnimator->pixmap(index);
} else {
pixmap = index.data(Qt::DecorationRole).value<QIcon>().pixmap(iconSize, iconMode);
pixmap = index.data(Qt::DecorationRole).value<QIcon>().pixmap(iconSize);
}
painter->drawPixmap(iconRect, pixmap);
leftPosition += iconRect.width() + m_padding;

Loading…
Cancel
Save