V3: add note colouring
This commit is contained in:
parent
6061b20398
commit
1db3990cd6
@ -34,7 +34,7 @@ from helpers import (
|
||||
set_track_metadata,
|
||||
)
|
||||
from log import log
|
||||
from models import Playdates, PlaylistRows, Tracks
|
||||
from models import NoteColours, Playdates, PlaylistRows, Tracks
|
||||
|
||||
|
||||
HEADER_NOTES_COLUMN = 1
|
||||
@ -213,6 +213,13 @@ class PlaylistModel(QAbstractTableModel):
|
||||
return QBrush(QColor(Config.COLOUR_BITRATE_MEDIUM))
|
||||
else:
|
||||
return QBrush(QColor(Config.COLOUR_BITRATE_OK))
|
||||
if column == Col.NOTE.value:
|
||||
with Session() as session:
|
||||
note_colour = NoteColours.get_colour(session, prd.note)
|
||||
if note_colour:
|
||||
return QBrush(QColor(note_colour))
|
||||
else:
|
||||
return QBrush()
|
||||
|
||||
return QBrush()
|
||||
|
||||
|
||||
@ -225,6 +225,9 @@ class PlaylistTab(QTableView):
|
||||
# edited
|
||||
self.data_model.update_track_times()
|
||||
|
||||
# Deselect edited line
|
||||
self.clear_selection()
|
||||
|
||||
def dropEvent(self, event):
|
||||
if event.source() is not self or (
|
||||
event.dropAction() != Qt.DropAction.MoveAction
|
||||
|
||||
Loading…
Reference in New Issue
Block a user