Skip to content

Commit

Permalink
Revert back to constant for fingerprint column (FINGERPRINT_COLUMN)
Browse files Browse the repository at this point in the history
  • Loading branch information
zas committed May 8, 2024
1 parent e1cbff8 commit 84f6fe7
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions picard/ui/itemviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ def _sortkey_filesize(obj):


ITEM_ICON_COLUMN = DEFAULT_COLUMNS.pos('title')
FINGERPRINT_COLUMN = DEFAULT_COLUMNS.pos('~fingerprint')


class MainPanel(QtWidgets.QSplitter):
Expand Down Expand Up @@ -1219,7 +1220,6 @@ class TrackItem(TreeItem):

def update(self, update_album=True, update_files=True, update_selection=True):
track = self.obj
fingerprint_column = DEFAULT_COLUMNS.pos('~fingerprint')
num_linked_files = track.num_linked_files
if num_linked_files == 1:
file = track.files[0]
Expand All @@ -1230,16 +1230,16 @@ def update(self, update_album=True, update_files=True, update_selection=True):
self.takeChildren()
self.setExpanded(False)
fingerprint_icon, fingerprint_tooltip = FileItem.decide_fingerprint_icon_info(file)
self.setToolTip(fingerprint_column, fingerprint_tooltip)
self.setIcon(fingerprint_column, fingerprint_icon)
self.setToolTip(FINGERPRINT_COLUMN, fingerprint_tooltip)
self.setIcon(FINGERPRINT_COLUMN, fingerprint_icon)
else:
if num_linked_files == 0:
icon_tooltip = _("There are no files matched to this track")
else:
icon_tooltip = ngettext('%i matched file', '%i matched files',
num_linked_files) % num_linked_files
self.setToolTip(fingerprint_column, "")
self.setIcon(fingerprint_column, QtGui.QIcon())
self.setToolTip(FINGERPRINT_COLUMN, "")
self.setIcon(FINGERPRINT_COLUMN, QtGui.QIcon())
if track.ignored_for_completeness():
color = TreeItem.text_color_secondary
else:
Expand Down Expand Up @@ -1290,13 +1290,12 @@ class FileItem(TreeItem):

def update(self, update_track=True, update_selection=True):
file = self.obj
fingerprint_column = DEFAULT_COLUMNS.pos('~fingerprint')
icon, icon_tooltip = FileItem.decide_file_icon_info(file)
self.setIcon(ITEM_ICON_COLUMN, icon)
self.setToolTip(ITEM_ICON_COLUMN, icon_tooltip)
fingerprint_icon, fingerprint_tooltip = FileItem.decide_fingerprint_icon_info(file)
self.setToolTip(fingerprint_column, fingerprint_tooltip)
self.setIcon(fingerprint_column, fingerprint_icon)
self.setToolTip(FINGERPRINT_COLUMN, fingerprint_tooltip)
self.setIcon(FINGERPRINT_COLUMN, fingerprint_icon)
color = FileItem.file_colors[file.state]
bgcolor = get_match_color(file.similarity, TreeItem.base_color)
self.update_colums_text(color=color, bgcolor=bgcolor)
Expand Down

0 comments on commit 84f6fe7

Please sign in to comment.