mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
VerticalTabs: Don't use selected icon mode for favicons
On some styles (particularly QStyleSheetStyle) it returns pixmap drawn onto background color.
This commit is contained in:
parent
4db34d4645
commit
ca60f9a300
@ -56,8 +56,6 @@ void TabListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &optio
|
|||||||
const int height = opt.rect.height();
|
const int height = opt.rect.height();
|
||||||
const int center = height / 2 + opt.rect.top();
|
const int center = height / 2 + opt.rect.top();
|
||||||
|
|
||||||
const QIcon::Mode iconMode = opt.state & QStyle::State_Selected ? QIcon::Selected : QIcon::Normal;
|
|
||||||
|
|
||||||
// Draw background
|
// Draw background
|
||||||
style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, w);
|
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()) {
|
if (index.data(TabModel::LoadingRole).toBool()) {
|
||||||
pixmap = m_loadingAnimator->pixmap(index);
|
pixmap = m_loadingAnimator->pixmap(index);
|
||||||
} else {
|
} else {
|
||||||
pixmap = index.data(Qt::DecorationRole).value<QIcon>().pixmap(iconSize, iconMode);
|
pixmap = index.data(Qt::DecorationRole).value<QIcon>().pixmap(iconSize);
|
||||||
}
|
}
|
||||||
painter->drawPixmap(iconRect, pixmap);
|
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 leftPosition = opt.rect.left() + m_indentation + m_indentation * depth + m_padding;
|
||||||
int rightPosition = opt.rect.right() - m_padding * 2 - m_closeButton->size().width();
|
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;
|
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;
|
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()) {
|
if (index.data(TabModel::LoadingRole).toBool()) {
|
||||||
pixmap = m_loadingAnimator->pixmap(index);
|
pixmap = m_loadingAnimator->pixmap(index);
|
||||||
} else {
|
} else {
|
||||||
pixmap = index.data(Qt::DecorationRole).value<QIcon>().pixmap(iconSize, iconMode);
|
pixmap = index.data(Qt::DecorationRole).value<QIcon>().pixmap(iconSize);
|
||||||
}
|
}
|
||||||
painter->drawPixmap(iconRect, pixmap);
|
painter->drawPixmap(iconRect, pixmap);
|
||||||
leftPosition += iconRect.width() + m_padding;
|
leftPosition += iconRect.width() + m_padding;
|
||||||
|
Loading…
Reference in New Issue
Block a user