From 65c9c695685b005656fd4d89b457b4d964dcf65e Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Sat, 16 Jan 2021 13:29:55 +0100 Subject: Fix priority foreground color on colored separators. --- src/modlistview.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/modlistview.cpp') diff --git a/src/modlistview.cpp b/src/modlistview.cpp index ad75631c..3c32d02a 100644 --- a/src/modlistview.cpp +++ b/src/modlistview.cpp @@ -89,14 +89,13 @@ public: // but the mod list view uses alternate color so we need to find the // right color auto bg = opt.palette.base().color(); - auto vrow = (opt.rect.y() - m_view->verticalOffset()) / opt.rect.height(); - if (vrow % 2 == 1) { + if (opt.features & QStyleOptionViewItem::Alternate) { bg = opt.palette.alternateBase().color(); } // compute ideal foreground color for some rows if (color.isValid()) { - if ((index.column() == ModList::COL_NAME + if (((index.column() == ModList::COL_NAME || index.column() == ModList::COL_PRIORITY) && ModInfo::getByIndex(index.data(ModList::IndexRole).toInt())->isSeparator()) || index.column() == ModList::COL_NOTES) { -- cgit v1.3.1