From 7eb59317f9a4dca9fd0e849ed5e5ea5c9e7066fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Sat, 23 Jan 2021 08:49:54 +0100 Subject: [PATCH] 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. --- src/playlist.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/playlist.js b/src/playlist.js index 4a3fc885..a26eaf12 100644 --- a/src/playlist.js +++ b/src/playlist.js @@ -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--;