Rather than trying to implement this myself through manually moving the
scrolled window. It's much easier to simply let Gtk do the work for us.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This simplifies the code a lot by letting the TrackList directly call
OSD functions without going through the TrackView. I can also simplify
the TrackView to just contain our columnview.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The Add Tracks button is a popover button configured to display a list
of playlists that tracks could be added to. I take some extra care to
make sure we only display playlists that have their user-tracks property
set to True, and to hide the currently visible playlist from the list.
Additionally, I create a horizontal size group so the Add and Remove
buttons are the same size.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The button is placed inside a Gtk.Overlay, and is hidden by default. The
button will be shown when tracks are selected if the current Playlist
has its "user-tracks" property set to True.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The OSD will eventually contain buttons for modifying playlists, but for
now it just has functions and properties for mananging the current track
selection.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
And wire this up to not only the Now Playing "jump" signal, but also the
next track pickers so we scroll when tracks are changed.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The MediumName TrackRow is used to combine the album and medium names
into a single string. This means we won't need to have a separate medium
name column that is empty for most tracks.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The AlbumCover shows a cover.jpg image for a specific Album in a column.
I also need to do some special handling so generate a tooltip to show a
larger version of the image.
I try to cache the AlbumCover Texture to cut down on disk accesses,
since we'll usually end up loading the same image several times for each
track in an album.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is an InscriptionRow that binds a Track's Album's property to the
Gtk.Inscription. I use it to display album artist and release information
in columns.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
These are specially configured TrackRows that take a non-string Track
property and convert it into a string displayed in the Inscription. I
use them to add Length, Play Count, Last Started, Last Played, and
Filepath columns to the TrackView.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The TrackRow widget is used to bind Tracks to a generic Widget. The
InscriptionRow builds on this to create a Gtk.Inscription that can be
used in derived classes. Finally, the TrackString widget implements
binding a string Track property directly to the Inscription.
I use these widgets to create a Title and Artist column in the
TrackView.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The TrackView sets up a scrollable Gtk.ColumnView inside a nice looking
frame. It also creates a FilterListModel for filtering tracks in a
separate layer from the Playlist so we don't affect choosing the next
track.
Finally, I add the TrackView to the TrackList Card.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>