Highlight leading gap when adding track to header

Fixes #142
This commit is contained in:
Keith Edmunds 2022-10-15 10:21:23 +01:00
parent 39f5374b32
commit 69afb2986e

View File

@ -1240,7 +1240,10 @@ class PlaylistTab(QTableWidget):
# Update attributes of row
self.item(row, USERDATA).setData(self.ROW_TRACK_ID, track.id)
self.item(row, START_GAP).setText(str(track.start_gap))
start_gap_item = self.item(row, START_GAP)
start_gap_item.setText(str(track.start_gap))
if track.start_gap and track.start_gap >= 500:
start_gap_item.setBackground(QColor(Config.COLOUR_LONG_START))
self.item(row, TITLE).setText(str(track.title))
self.item(row, ARTIST).setText(str(track.artist))
self.item(row, DURATION).setText(ms_to_mmss(track.duration))