feishinization continues

This commit is contained in:
Erica Z 2024-10-27 22:01:49 +01:00
parent 77f9d70d29
commit 3f7f7d4ce9
3 changed files with 23 additions and 10 deletions

View file

@ -29,8 +29,6 @@ template $UiPlayQueue: Box {
show-separators: true; show-separators: true;
single-click-activate: true; single-click-activate: true;
styles [ "rich-list" ]
activate => $on_row_activated (); activate => $on_row_activated ();
model: NoSelection { model: NoSelection {

View file

@ -5,7 +5,9 @@ class Ui.PlayQueueSong : Gtk.Box {
public bool draggable { get; set; default = false; } public bool draggable { get; set; default = false; }
public bool show_position { get; set; default = false; } public bool show_position { get; set; default = false; }
public bool show_artist { get; set; default = false; } public bool show_artist { get; set; default = false; }
public bool show_album { get; set; default = false; } public bool show_cover { get; set; default = false; }
public Gdk.Paintable cover { get; private set; } // FIXME actually show the thing lol
private bool _current = false; private bool _current = false;
public bool current { public bool current {
@ -80,8 +82,8 @@ class Ui.PlayQueueSong : Gtk.Box {
drag_row.draggable = false; drag_row.draggable = false;
drag_row.show_position = this.show_position; drag_row.show_position = this.show_position;
drag_row.show_artist = this.show_artist; drag_row.show_artist = this.show_artist;
drag_row.show_album = this.show_album; drag_row.show_cover = this.show_cover;
drag_row.current = this.current; drag_row.current = false;
drag_row.displayed_position = this.displayed_position; drag_row.displayed_position = this.displayed_position;
drag_row.song = this.song; drag_row.song = this.song;
drag_row.set_size_request (this.get_width (), this.get_height ()); drag_row.set_size_request (this.get_width (), this.get_height ());
@ -91,7 +93,6 @@ class Ui.PlayQueueSong : Gtk.Box {
this.drag_widget.append (drag_row_real); this.drag_widget.append (drag_row_real);
this.drag_widget.drag_highlight_row (drag_row_real); this.drag_widget.drag_highlight_row (drag_row_real);
this.drag_widget.add_css_class ("rich-list");
var drag_icon = Gtk.DragIcon.get_for_drag (drag); var drag_icon = Gtk.DragIcon.get_for_drag (drag);
drag_icon.set("child", this.drag_widget); drag_icon.set("child", this.drag_widget);
@ -141,7 +142,7 @@ public class Ui.PlayQueue : Gtk.Box {
child.draggable = true; child.draggable = true;
child.show_position = true; child.show_position = true;
child.show_artist = true; child.show_artist = true;
child.show_album = true; child.show_cover = true;
item.child = child; item.child = child;
} }

View file

@ -1,8 +1,13 @@
using Gtk 4.0; using Gtk 4.0;
template $UiPlayQueueSong: Box { template $UiPlayQueueSong: Box {
height-request: 48;
spacing: 12;
margin-start: 6;
margin-end: 6;
Box { Box {
width-request: 24; width-request: 36;
focusable: false; focusable: false;
homogeneous: true; homogeneous: true;
@ -25,10 +30,19 @@ template $UiPlayQueueSong: Box {
} }
} }
Image {
visible: bind template.show_cover;
margin-top: 1;
margin-bottom: 1;
pixel-size: 50;
paintable: bind template.cover;
}
Box title_box { Box title_box {
styles [ "header"] styles [ "header"]
focusable: false; focusable: false;
hexpand: true; hexpand: true;
valign: center;
Box { Box {
styles [ "title" ] styles [ "title" ]
@ -43,7 +57,6 @@ template $UiPlayQueueSong: Box {
ellipsize: end; ellipsize: end;
max-width-chars: 90; max-width-chars: 90;
justify: fill; justify: fill;
margin-start: 9;
label: bind template.song as <$SubsonicSong>.title; label: bind template.song as <$SubsonicSong>.title;
} }
@ -57,7 +70,6 @@ template $UiPlayQueueSong: Box {
ellipsize: end; ellipsize: end;
max-width-chars: 90; max-width-chars: 90;
justify: fill; justify: fill;
margin-start: 9;
label: bind template.song as <$SubsonicSong>.artist; label: bind template.song as <$SubsonicSong>.artist;
} }
@ -78,6 +90,7 @@ template $UiPlayQueueSong: Box {
focusable: true; focusable: true;
icon-name: bind $star_button_icon_name (template.song as <$SubsonicSong>.starred) as <string>; icon-name: bind $star_button_icon_name (template.song as <$SubsonicSong>.starred) as <string>;
styles [ "flat" ] styles [ "flat" ]
valign: center;
} }
MenuButton { MenuButton {
@ -85,6 +98,7 @@ template $UiPlayQueueSong: Box {
focusable: true; focusable: true;
icon-name: "view-more"; icon-name: "view-more";
styles [ "flat" ] styles [ "flat" ]
valign: center;
popover: PopoverMenu { popover: PopoverMenu {
menu-model: song-menu; menu-model: song-menu;