From 8f51e790b5b29ce8a08ddfba1097aeed004722ab Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Fri, 1 Dec 2023 10:36:11 +0000 Subject: [PATCH] Fix header row colours Fixes #206 --- app/playlistmodel.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/playlistmodel.py b/app/playlistmodel.py index 31693d4..32bcffd 100644 --- a/app/playlistmodel.py +++ b/app/playlistmodel.py @@ -190,8 +190,14 @@ class PlaylistModel(QAbstractTableModel): # Handle entire row colouring # Header row - if not prd.path: - return QBrush(QColor(Config.COLOUR_NOTES_PLAYLIST)) + if self.is_header_row(row): + # Check for specific header colouring + with Session() as session: + note_colour = NoteColours.get_colour(session, prd.note) + if note_colour: + return QBrush(QColor(note_colour)) + else: + return QBrush(QColor(Config.COLOUR_NOTES_PLAYLIST)) # Unreadable track file if file_is_unreadable(prd.path): return QBrush(QColor(Config.COLOUR_UNREADABLE))