And make sure we center the pixbuf in the GtkImage by allowing the image
to expand to its maximum width.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This acts as a placeholder, and keeps the sidebar from bouncing around
when tracks are changed.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I always scale from the original reference image, and never from the
displayed pixbuf. This avoids artifacts due to lossy scaling algorithms.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
And keep it as a global variable. This reduces the amount of work in the
root node, and makes things a little easier to follow
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Rather than continuing to use the tree lock. This lets us be a little
more focused in what the locks protect, while also allowing tree
operations to happen in parallel with playlist operations.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The child-inserted notification is more specific than node-inserted, and
carries the child's path with it as an argument. This saves some work on
the UI side, and avoids potential deadlocks.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
- Listen for the "first-child" notification rather than "node-inserted"
- Use the walrus operator in more places to tidy up the code
- Use the playlist_iter() function to get iterators directly
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
And always run tasks marked for the idle queue in the idle queue, even
if we're in the main thread.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This lets us save str(node) to be used for something else, and it gives
playlists a chance to escape their names before returning to the UI
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I really want to remove this function, so let's start by swapping out
calls to append_child() with insert_child()
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
It is way faster during scanning due to the db key changes, which I
wasn't expecting at the time.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The "tags" name doesn't really fit anymore now that we removed the Album
class. Let's change the name to something more accurate.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
- Clean up the code
- Kick off a GLib idle handler when events are added
- If we are already running in the main thread, then we don't need to
use the idle handler.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Rather than doing this in multiple places outside of the track class.
Callers who want the original values can still dereference the value
directly
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Even though this is a ListModel the TreeModelFilter still tries to call
this function, so we need to define it to cut down on warnings printed
to the screen.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
The node view file has these extra newlines already, and I think it
makes everything easier to follow.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This playlist is only to showe new tracks added during the current
session, so we need to clear the list when getting the playlist state
dictionary.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
If our filter text has no results, then backing out could lead to
partially cutting off node text.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Similar to how we add tracks to the starred playlist. I was having
trouble getting the treeview to update properly, so I take the
heavy-handed approach of redrawing the entire view.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Otherwise we'll select an additional row with every track change, never
unselecting previous tracks.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This function is now unused, since we're using bisection insertion
instead. We switch remaining callers over to using node.append_child()
while we're at it.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I needed to switch starring multiple tracks at once to happen during a
button press instead of release, since the selection changes between
these two events.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Testing this runs into the same problem that the TreeDragSource patch
hit - we're not able to manually allocate a Gtk.SelectionData object. We
can still test the code that does the move but we can't verify that
we're using the interface correctly
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We're not able to completely test this implementation due to
Gtk.SelectionData() missing a constructor. Fingers crossed that it gets
added in a future release of python-gobject
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
There are a few places where we need to do this, so make a function that
is more straightforward than using an iterator
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Let's just set the visible state directly. Additionally, I add a test
for setting visibility back to false when showing a different playlist
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This lets us clean up add() so we only need to loop over the list once
and we can remove the buggy built-in iterator code.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>