Mark active playlist item with "play" icon

This commit is contained in:
Rafał Dzięgiel
2021-01-22 21:57:09 +01:00
parent 70fcc38857
commit a82a36c6b5

View File

@@ -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);