2024-10-19 11:07:22 +00:00
|
|
|
using Gtk 4.0;
|
|
|
|
|
2024-10-20 15:46:59 +00:00
|
|
|
template $UiPlayQueueSong: Box {
|
2024-10-19 11:07:22 +00:00
|
|
|
Box {
|
|
|
|
focusable: false;
|
|
|
|
spacing: 6;
|
|
|
|
|
|
|
|
Image {
|
2024-10-20 09:57:47 +00:00
|
|
|
visible: bind template.draggable;
|
2024-10-19 11:07:22 +00:00
|
|
|
icon-name: "list-drag-handle";
|
|
|
|
styles [ "drag-handle" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
Box {
|
|
|
|
width-request: 48;
|
|
|
|
focusable: false;
|
|
|
|
homogeneous: true;
|
|
|
|
|
|
|
|
Image {
|
|
|
|
focusable: false;
|
|
|
|
icon-size: normal;
|
2024-10-19 12:04:52 +00:00
|
|
|
icon-name: bind template.play-icon-name;
|
2024-10-19 11:07:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
2024-10-20 12:26:51 +00:00
|
|
|
visible: bind template.show_position;
|
2024-10-19 11:07:22 +00:00
|
|
|
focusable: false;
|
|
|
|
halign: end;
|
|
|
|
justify: right;
|
|
|
|
styles [ "dim-label", "numeric" ]
|
|
|
|
|
2024-10-19 12:04:52 +00:00
|
|
|
label: bind template.displayed_position;
|
2024-10-19 11:07:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Box title_box {
|
|
|
|
focusable: false;
|
|
|
|
hexpand: true;
|
|
|
|
|
2024-10-27 11:20:43 +00:00
|
|
|
Box {
|
|
|
|
orientation: vertical;
|
|
|
|
|
|
|
|
Label {
|
|
|
|
focusable: false;
|
|
|
|
xalign: 0;
|
|
|
|
halign: start;
|
|
|
|
hexpand: true;
|
|
|
|
ellipsize: end;
|
|
|
|
max-width-chars: 90;
|
|
|
|
justify: fill;
|
|
|
|
margin-start: 9;
|
|
|
|
|
|
|
|
label: bind template.song as <$SubsonicSong>.title;
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
focusable: false;
|
|
|
|
xalign: 0;
|
|
|
|
halign: start;
|
|
|
|
hexpand: true;
|
|
|
|
ellipsize: end;
|
|
|
|
max-width-chars: 90;
|
|
|
|
justify: fill;
|
|
|
|
margin-start: 9;
|
|
|
|
|
|
|
|
label: bind template.song as <$SubsonicSong>.artist;
|
|
|
|
|
|
|
|
styles [ "dim-label" ]
|
|
|
|
}
|
2024-10-19 11:07:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Box artist_box {
|
2024-10-20 09:57:47 +00:00
|
|
|
visible: bind template.show_artist;
|
2024-10-19 11:07:22 +00:00
|
|
|
focusable: false;
|
|
|
|
hexpand: true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Box album_duration_box {
|
|
|
|
focusable: false;
|
|
|
|
hexpand: true;
|
|
|
|
spacing: 6;
|
|
|
|
|
2024-10-27 11:20:43 +00:00
|
|
|
/*
|
2024-10-19 11:07:22 +00:00
|
|
|
Label {
|
2024-10-20 09:57:47 +00:00
|
|
|
visible: bind template.show_album;
|
2024-10-19 11:07:22 +00:00
|
|
|
focusable: false;
|
|
|
|
xalign: 0;
|
|
|
|
halign: start;
|
|
|
|
hexpand: true;
|
|
|
|
ellipsize: end;
|
|
|
|
max-width-chars: 90;
|
|
|
|
justify: fill;
|
|
|
|
|
|
|
|
label: bind template.song as <$SubsonicSong>.album;
|
|
|
|
}
|
2024-10-27 11:20:43 +00:00
|
|
|
*/
|
2024-10-19 11:07:22 +00:00
|
|
|
|
|
|
|
Label {
|
|
|
|
focusable: false;
|
|
|
|
halign: end;
|
|
|
|
hexpand: true;
|
|
|
|
single-line-mode: true;
|
|
|
|
styles [ "numeric" ]
|
|
|
|
|
|
|
|
label: bind $format_duration (template.song as <$SubsonicSong>.duration) as <string>;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
focusable: true;
|
|
|
|
icon-name: bind $star_button_icon_name (template.song as <$SubsonicSong>.starred) as <string>;
|
|
|
|
styles [ "flat" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
MenuButton {
|
|
|
|
//visible: false;
|
|
|
|
focusable: true;
|
|
|
|
icon-name: "view-more";
|
|
|
|
styles [ "flat" ]
|
2024-10-19 12:39:44 +00:00
|
|
|
|
|
|
|
popover: PopoverMenu {
|
|
|
|
menu-model: song-menu;
|
|
|
|
};
|
2024-10-19 11:07:22 +00:00
|
|
|
}
|
|
|
|
}
|
2024-10-19 11:55:25 +00:00
|
|
|
|
|
|
|
DragSource {
|
|
|
|
actions: move;
|
|
|
|
propagation-phase: capture;
|
|
|
|
|
|
|
|
prepare => $on_drag_prepare ();
|
2024-10-20 12:24:04 +00:00
|
|
|
drag-begin => $on_drag_begin ();
|
2024-10-19 11:55:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DropTarget {
|
|
|
|
actions: move;
|
2024-10-20 09:52:51 +00:00
|
|
|
formats: "UiPlayQueueSong";
|
2024-10-19 11:55:25 +00:00
|
|
|
preload: true;
|
|
|
|
|
|
|
|
drop => $on_drop ();
|
|
|
|
}
|
2024-10-19 11:07:22 +00:00
|
|
|
}
|
|
|
|
|
2024-10-27 11:20:43 +00:00
|
|
|
/*
|
2024-10-19 11:07:22 +00:00
|
|
|
SizeGroup {
|
|
|
|
mode: horizontal;
|
|
|
|
widgets [title_box, artist_box, album_duration_box]
|
|
|
|
}
|
2024-10-27 11:20:43 +00:00
|
|
|
*/
|
2024-10-19 12:39:44 +00:00
|
|
|
|
|
|
|
menu song-menu {
|
2024-10-20 14:47:35 +00:00
|
|
|
item ("View song", "song.view")
|
|
|
|
item ("View artist", "song.view-artist")
|
|
|
|
item ("View album", "song.view-album")
|
|
|
|
item ("Share", "song.share")
|
2024-10-19 12:39:44 +00:00
|
|
|
item ("Remove", "song.remove")
|
|
|
|
}
|