1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

IconChooser: Fix drawing with HighDPI

This commit is contained in:
David Rosca 2016-12-27 14:18:33 +01:00
parent 157889db70
commit 937542b411

View File

@ -121,8 +121,9 @@ void IconChooserDelegate::paint(QPainter* painter, const QStyleOptionViewItem &o
style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, w);
// Draw icon
const int padding = opt.rect.width() / 4;
const QIcon icon = index.data(Qt::DecorationRole).value<QIcon>();
icon.paint(painter, opt.rect);
icon.paint(painter, opt.rect.adjusted(padding, padding, -padding, -padding));
}
QSize IconChooserDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const