Close app when removing active item from playlist

Make playlist remove button act the same as close button for currently playing file. This allows using it to close the app without leaving fullscreen.
This commit is contained in:
Rafał Dzięgiel
2021-01-23 08:49:54 +01:00
parent f993a9e16c
commit 7eb59317f9

View File

@@ -22,10 +22,12 @@ class ClapperPlaylistWidget extends Gtk.ListBox
{
const itemIndex = item.get_index();
/* TODO: Handle this case somehow (should app quit?)
* or disable remove button */
if(itemIndex === this.activeRowId)
if(itemIndex === this.activeRowId) {
const root = this.get_root();
root.emit('close-request');
return;
}
if(itemIndex < this.activeRowId)
this.activeRowId--;