1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-22 02:02:10 +02:00

IconChooser: Fix drawing selected item with fusion style

This commit is contained in:
David Rosca 2016-12-25 20:35:57 +01:00
parent c9797f5600
commit 83444d8851

View File

@ -117,15 +117,11 @@ void IconChooserDelegate::paint(QPainter* painter, const QStyleOptionViewItem &o
const QStyle* style = w ? w->style() : QApplication::style(); const QStyle* style = w ? w->style() : QApplication::style();
// Draw background // Draw background
if (mApp->styleName() == QLatin1String("fusion")) { opt.showDecorationSelected = true;
style->drawPrimitive(QStyle::PE_PanelItemViewRow, &opt, painter, w);
}
else {
style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, w); style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, w);
}
// Draw icon // Draw icon
QIcon icon = index.data(Qt::DecorationRole).value<QIcon>(); const QIcon icon = index.data(Qt::DecorationRole).value<QIcon>();
icon.paint(painter, opt.rect); icon.paint(painter, opt.rect);
} }