Use old ProjectItem highlight on Windows styles (#4466)

This commit is contained in:
Alexandru Ionut Tripon
2025-12-14 00:56:30 +02:00
committed by GitHub

View File

@@ -24,10 +24,17 @@ void ProjectItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o
auto rect = opt.rect;
style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, opt.widget);
bool windows = style->objectName().startsWith("windows");
if (!windows)
style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, opt.widget);
if (isSelected) {
if (windows)
painter->fillRect(rect, opt.palette.highlight());
if (isSelected && style->objectName() != "windowsvista")
painter->setPen(opt.palette.highlightedText().color());
}
if (opt.features & QStyleOptionViewItem::HasCheckIndicator) {
QStyleOptionViewItem checkboxOpt = makeCheckboxStyleOption(opt, style);