Add playlist widget to elapsed time button popover

This commit is contained in:
Rafostar
2021-01-19 14:40:25 +01:00
parent fca7966ece
commit 3ba21d42ec
8 changed files with 345 additions and 118 deletions

View File

@@ -17,7 +17,6 @@ class ClapperApp extends AppBase
this.get_flags()
| Gio.ApplicationFlags.HANDLES_OPEN
);
this.playlist = [];
}
vfunc_startup()
@@ -42,10 +41,12 @@ class ClapperApp extends AppBase
{
super.vfunc_open(files, hint);
this.playlist = files;
const { player } = this.active_window.get_child();
if(this.doneFirstActivate)
this.setWindowPlaylist(this.active_window);
if(!this.doneFirstActivate)
player._preparePlaylist(files);
else
player.set_playlist(files);
this.activate();
}
@@ -54,15 +55,12 @@ class ClapperApp extends AppBase
{
super._onWindowShow(window);
this.setWindowPlaylist(window);
}
const { player } = this.active_window.get_child();
const success = player.playlistWidget.nextTrack();
setWindowPlaylist(window)
{
if(!this.playlist.length)
return;
if(!success)
debug('playlist is empty');
const { player } = window.get_child();
player.set_playlist(this.playlist);
player.widget.grab_focus();
}
});