diff src/gui/pages/anime_list.cc @ 399:a0bc3ae5164a

anime_list: actually obey "highlight anime if they are available"
author Paper <paper@tflc.us>
date Fri, 07 Nov 2025 15:28:22 -0500
parents f7bb2978de48
children 2f4dc1580b84
line wrap: on
line diff
--- a/src/gui/pages/anime_list.cc	Fri Nov 07 14:32:11 2025 -0500
+++ b/src/gui/pages/anime_list.cc	Fri Nov 07 15:28:22 2025 -0500
@@ -76,6 +76,8 @@
 
 bool AnimeListPageSortFilter::lessThan(const QModelIndex &l, const QModelIndex &r) const
 {
+	/* TODO obey session.config.anime_list.highlighted_anime_above_others;
+	 * need to add a huge bias towards unavailable anime */
 	QVariant left = sourceModel()->data(l, sortRole());
 	QVariant right = sourceModel()->data(r, sortRole());
 
@@ -174,6 +176,11 @@
 				default: return "";
 			}
 			break;
+		case Qt::ForegroundRole:
+			if (session.config.anime_list.highlight_anime_if_available && Library::db.GetAnimeFolder(list[index.row()].GetId()))
+				/* Did we have a global palette state? Lol */
+				return QPalette().color(QPalette::Highlight);
+			break;
 		case Qt::UserRole:
 			switch (index.column()) {
 				case AL_PROGRESS: return list[index.row()].GetUserProgress();