mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
Mark active playlist item with "play" icon
This commit is contained in:
@@ -71,9 +71,25 @@ class ClapperPlaylistWidget extends Gtk.ListBox
|
|||||||
return row.isLocalFile;
|
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)
|
_onRowActivated(listBox, row)
|
||||||
{
|
{
|
||||||
const { player } = this.get_ancestor(Gtk.Grid);
|
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();
|
this.activeRowId = row.get_index();
|
||||||
player.set_uri(row.uri);
|
player.set_uri(row.uri);
|
||||||
|
Reference in New Issue
Block a user