Where in the Source Code are the Graphic icons handled?

Tags: #<Tag:0x00007ff145e09de8>

The album status, track matching status, etc. I’ve tried following backwards by looking for where the graphic is referenced in the source and I can’t find anything.

I would think it’s in /picard/picard/album.py but while I see references to self.status, I don’t see how that is being applied.

It’s all in itemviews.py, there depending on status the colors and icons get applied.

1 Like

What I can’t figure out is how/where the icons are combined with the titles.

There’s the match / match pending which I would like to see the routine for choosing which one, 90, 80, 70, 60… gets affixed to the track title. I want to see about changing the text colors in the percentage complete column to be green when it’s 100%, red when it’s less than 50%…

…and the silver/gold record with the overlaid asterisk or not. Where does that get affixed to the left of the album title?

I want to see if I can separate the album graphic from the album title, to it’s own column. Why? To understand how graphic content only would be put in a column mostly.

I’d also like to figure out separating the columns from the Left and Right, since anything I’ve added appears in both, so lets leave out the irrelevant ones from the Left.

Hmm… maybe it’s being imported from itemviews.py into both album.py and cluster.py … so make a separate list for cluster…

…and fix the save column positions and widths on quit and that would be golden UI wise.

It’s all handled in itemviews.py, album.py and cluster.py don’t deal with UI at all. The icons are set with calls to setIcon on the various items being displayed. There are classes for each type of item (ClusterItem, AlbumItem, TrackItem etc.). Each item class is handling setting an appropriate icon for itself.

The left column is managed by the class FileTreeView (itemviews.py#L610), the right column by AlbumTreeView (itemviews.py#L640). Both inherit from BaseTreeView, which currently sets the displayed column to what is defined in MainPanel.columns. So same columns for both views, but this could of course be split for the separate views.

1 Like