chore: move oppacity after checkbox draw

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2025-06-07 09:10:03 +03:00
parent 9f9aabcf97
commit 8a80ccae3a

View file

@ -20,9 +20,6 @@ void ProjectItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o
auto isChecked = opt.checkState == Qt::Checked;
auto isSelected = option.state & QStyle::State_Selected;
if (!isSelected && !isChecked && isInstalled) {
painter->setOpacity(0.4); // Fade out the entire item
}
const QStyle* style = opt.widget == nullptr ? QApplication::style() : opt.widget->style();
auto rect = opt.rect;
@ -39,6 +36,9 @@ void ProjectItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o
rect.setX(checkboxOpt.rect.right());
}
if (!isSelected && !isChecked && isInstalled) {
painter->setOpacity(0.4); // Fade out the entire item
}
// The default icon size will be a square (and height is usually the lower value).
auto icon_width = rect.height(), icon_height = rect.height();
int icon_x_margin = (rect.height() - icon_width) / 2;