only show cover art in playbar if view isnt play queue
This commit is contained in:
parent
fa9d3b873f
commit
af4da894fc
4 changed files with 55 additions and 21 deletions
|
@ -10,6 +10,15 @@ template $UiPlaybar: Box {
|
||||||
|
|
||||||
[start]
|
[start]
|
||||||
Box {
|
Box {
|
||||||
|
Picture {
|
||||||
|
visible: bind template.show_cover_art;
|
||||||
|
valign: center;
|
||||||
|
halign: center;
|
||||||
|
paintable: bind template.playing_cover_art;
|
||||||
|
}
|
||||||
|
|
||||||
|
Box {
|
||||||
|
margin-start: 6;
|
||||||
orientation: vertical;
|
orientation: vertical;
|
||||||
valign: center;
|
valign: center;
|
||||||
|
|
||||||
|
@ -35,6 +44,7 @@ template $UiPlaybar: Box {
|
||||||
ellipsize: end;
|
ellipsize: end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[center]
|
[center]
|
||||||
Box {
|
Box {
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
[GtkTemplate (ui = "/eu/callcc/audrey/ui/playbar.ui")]
|
[GtkTemplate (ui = "/eu/callcc/audrey/ui/playbar.ui")]
|
||||||
class Ui.Playbar : Gtk.Box {
|
class Ui.Playbar : Gtk.Box {
|
||||||
public Subsonic.Song? song { get; set; }
|
public Subsonic.Song? song { get; set; }
|
||||||
|
public Gdk.Paintable? playing_cover_art { get; set; }
|
||||||
public Playbin playbin { get; set; }
|
public Playbin playbin { get; set; }
|
||||||
|
public bool show_cover_art { get; set; default = true; }
|
||||||
|
|
||||||
public int volume {
|
public int volume {
|
||||||
get { return playbin == null ? 100 : playbin.volume; }
|
get { return playbin == null ? 100 : playbin.volume; }
|
||||||
set { playbin.volume = value; }
|
set { playbin.volume = value; }
|
||||||
|
|
|
@ -36,8 +36,23 @@ template $UiWindow: Adw.ApplicationWindow {
|
||||||
|
|
||||||
content: Adw.ViewStack stack {
|
content: Adw.ViewStack stack {
|
||||||
Adw.ViewStackPage {
|
Adw.ViewStackPage {
|
||||||
title: _("Play queue");
|
icon-name: "audio-input-microphone";
|
||||||
|
title: _("Artists");
|
||||||
|
|
||||||
|
child: Box {};
|
||||||
|
}
|
||||||
|
|
||||||
|
Adw.ViewStackPage {
|
||||||
|
icon-name: "media-optical-cd";
|
||||||
|
title: _("Albums");
|
||||||
|
|
||||||
|
child: Box {};
|
||||||
|
}
|
||||||
|
|
||||||
|
Adw.ViewStackPage {
|
||||||
icon-name: "media-playback-start";
|
icon-name: "media-playback-start";
|
||||||
|
title: _("Play queue");
|
||||||
|
name: "play-queue";
|
||||||
|
|
||||||
child: Box {
|
child: Box {
|
||||||
name: "play-queue-page";
|
name: "play-queue-page";
|
||||||
|
@ -79,6 +94,8 @@ template $UiWindow: Adw.ApplicationWindow {
|
||||||
$UiPlaybar playbar {
|
$UiPlaybar playbar {
|
||||||
song: bind template.song;
|
song: bind template.song;
|
||||||
playbin: bind template.playbin;
|
playbin: bind template.playbin;
|
||||||
|
playing_cover_art: bind template.playing_cover_art;
|
||||||
|
show_cover_art: bind $show_playbar_cover_art (stack.visible-child-name) as <bool>;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,4 +111,8 @@ class Ui.Window : Adw.ApplicationWindow {
|
||||||
this.playbin.select_track (0);
|
this.playbin.select_track (0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[GtkCallback] private bool show_playbar_cover_art (string? stack_child) {
|
||||||
|
return stack_child != "play-queue";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue