From 937542b411acdf273f97fab8b11b8926b36519be Mon Sep 17 00:00:00 2001 From: David Rosca Date: Tue, 27 Dec 2016 14:18:33 +0100 Subject: [PATCH] IconChooser: Fix drawing with HighDPI --- src/lib/other/iconchooser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/other/iconchooser.cpp b/src/lib/other/iconchooser.cpp index 71b9384d2..46f8aae3c 100644 --- a/src/lib/other/iconchooser.cpp +++ b/src/lib/other/iconchooser.cpp @@ -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(); - 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