From a82a36c6b58684e810512cbbb88a84b5847f4a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Fri, 22 Jan 2021 21:57:09 +0100 Subject: [PATCH] Mark active playlist item with "play" icon --- src/playlist.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/playlist.js b/src/playlist.js index b93a7929..4a3fc885 100644 --- a/src/playlist.js +++ b/src/playlist.js @@ -71,9 +71,25 @@ class ClapperPlaylistWidget extends Gtk.ListBox return row.isLocalFile; } + deactivateActiveItem() + { + if(this.activeRowId < 0) + return; + + const row = this.get_row_at_index(this.activeRowId); + if(!row) return null; + + const icon = row.child.get_first_child(); + icon.icon_name = 'open-menu-symbolic'; + } + _onRowActivated(listBox, row) { const { player } = this.get_ancestor(Gtk.Grid); + const icon = row.child.get_first_child(); + + this.deactivateActiveItem(); + icon.icon_name = 'media-playback-start-symbolic'; this.activeRowId = row.get_index(); player.set_uri(row.uri);