fix(folderstatusdelegate): improve rendering of icons on HiDPI screens

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
This commit is contained in:
Jyrki Gadinger 2025-09-25 12:25:15 +02:00 committed by Matthieu Gallien
parent ff94d4b4ea
commit 73b9fbe70b

View File

@ -190,12 +190,14 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
localPathRect.setLeft(nextToIcon);
remotePathRect.setLeft(nextToIcon);
const auto iconSize = iconRect.width();
auto optionsButtonVisualRect = optionsButtonRect(option.rect, option.direction);
const auto statusPixmap = statusIcon.pixmap(iconSize, iconSize, syncEnabled ? QIcon::Normal : QIcon::Disabled);
painter->drawPixmap(QStyle::visualRect(option.direction, option.rect, iconRect).left(), iconRect.top(), statusPixmap);
statusIcon.paint(
painter,
QStyle::visualRect(option.direction, option.rect, iconRect),
Qt::AlignCenter,
syncEnabled ? QIcon::Normal : QIcon::Disabled
);
// only show the warning icon if the sync is running. Otherwise its
// encoded in the status icon.