1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01: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();
// Draw background
if (mApp->styleName() == QLatin1String("fusion")) {
style->drawPrimitive(QStyle::PE_PanelItemViewRow, &opt, painter, w);
}
else {
opt.showDecorationSelected = true;
style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, w);
}
// Draw icon
QIcon icon = index.data(Qt::DecorationRole).value<QIcon>();
const QIcon icon = index.data(Qt::DecorationRole).value<QIcon>();
icon.paint(painter, opt.rect);
}