From 69dd0235a0f6644b9236d12a7e6e2f4abeed97b0 Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Sat, 25 Sep 2021 22:33:17 +0100 Subject: [PATCH] Improve note colouring - Make case insensitive - If not starts with key, it's a match Fixes #71 --- app/playlists.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/playlists.py b/app/playlists.py index a9bc7b3..b378554 100644 --- a/app/playlists.py +++ b/app/playlists.py @@ -1032,10 +1032,9 @@ class PlaylistTab(QTableWidget): # Set colour note_colour = Config.COLOUR_NOTES_PLAYLIST note_text = self.item(row, self.COL_TITLE).text() - note_tokens = note_text.split(":", 1) - if len(note_tokens) == 2: - if note_tokens[0] in Config.NOTE_COLOURS: - note_colour = Config.NOTE_COLOURS[note_tokens[0]] + for colour_token in Config.NOTE_COLOURS.keys(): + if note_text.lower().startswith(colour_token.lower()): + note_colour = Config.NOTE_COLOURS[colour_token] self._set_row_colour( row, QColor(note_colour) )