2024-10-19 11:07:22 +00:00
|
|
|
using Gtk 4.0;
|
|
|
|
|
2024-10-29 14:46:33 +00:00
|
|
|
template $AudreyUiPlayQueueSong: Box {
|
2024-10-27 21:01:49 +00:00
|
|
|
height-request: 48;
|
|
|
|
spacing: 12;
|
|
|
|
|
2024-10-19 11:07:22 +00:00
|
|
|
Box {
|
2024-11-05 15:25:17 +00:00
|
|
|
margin-start: 6;
|
2024-10-27 21:01:49 +00:00
|
|
|
width-request: 36;
|
2024-10-19 11:07:22 +00:00
|
|
|
focusable: false;
|
2024-10-27 20:39:29 +00:00
|
|
|
homogeneous: true;
|
2024-10-19 11:07:22 +00:00
|
|
|
|
|
|
|
Image {
|
2024-10-27 20:39:29 +00:00
|
|
|
visible: bind template.current;
|
2024-10-19 11:07:22 +00:00
|
|
|
focusable: false;
|
2024-10-27 20:39:29 +00:00
|
|
|
halign: end;
|
|
|
|
icon-size: normal;
|
|
|
|
icon-name: "media-playback-start";
|
2024-10-19 11:07:22 +00:00
|
|
|
}
|
|
|
|
|
2024-10-27 20:39:29 +00:00
|
|
|
Label {
|
|
|
|
visible: bind template.current inverted;
|
2024-10-19 11:07:22 +00:00
|
|
|
focusable: false;
|
2024-10-27 20:39:29 +00:00
|
|
|
halign: end;
|
|
|
|
justify: right;
|
2024-11-06 11:46:49 +00:00
|
|
|
margin-top: 1;
|
|
|
|
margin-bottom: 1;
|
2024-11-05 08:29:08 +00:00
|
|
|
|
|
|
|
styles [
|
|
|
|
"dim-label",
|
|
|
|
"numeric"
|
|
|
|
]
|
2024-10-19 11:07:22 +00:00
|
|
|
|
2024-10-27 20:39:29 +00:00
|
|
|
label: bind template.displayed_position;
|
2024-10-19 11:07:22 +00:00
|
|
|
}
|
2024-10-27 20:39:29 +00:00
|
|
|
}
|
2024-10-19 11:07:22 +00:00
|
|
|
|
2024-10-27 21:01:49 +00:00
|
|
|
Image {
|
|
|
|
visible: bind template.show_cover;
|
|
|
|
margin-top: 1;
|
|
|
|
margin-bottom: 1;
|
|
|
|
pixel-size: 50;
|
2024-11-06 11:46:49 +00:00
|
|
|
paintable: bind template.song as <$AudreyModelSong>.thumbnail;
|
2024-10-27 21:01:49 +00:00
|
|
|
}
|
|
|
|
|
2024-10-27 20:39:29 +00:00
|
|
|
Box title_box {
|
2024-11-05 08:29:08 +00:00
|
|
|
styles [
|
|
|
|
"header"
|
|
|
|
]
|
|
|
|
|
2024-10-27 20:39:29 +00:00
|
|
|
focusable: false;
|
|
|
|
hexpand: true;
|
2024-10-27 21:01:49 +00:00
|
|
|
valign: center;
|
2024-10-27 20:39:29 +00:00
|
|
|
|
|
|
|
Box {
|
2024-11-05 08:29:08 +00:00
|
|
|
styles [
|
|
|
|
"title"
|
|
|
|
]
|
|
|
|
|
2024-10-27 20:39:29 +00:00
|
|
|
orientation: vertical;
|
2024-10-19 11:07:22 +00:00
|
|
|
|
|
|
|
Label {
|
2024-11-05 08:29:08 +00:00
|
|
|
styles [
|
|
|
|
"title"
|
|
|
|
]
|
|
|
|
|
2024-10-19 11:07:22 +00:00
|
|
|
focusable: false;
|
|
|
|
xalign: 0;
|
|
|
|
halign: start;
|
|
|
|
hexpand: true;
|
|
|
|
ellipsize: end;
|
|
|
|
max-width-chars: 90;
|
|
|
|
justify: fill;
|
2024-11-05 20:44:20 +00:00
|
|
|
label: bind template.song as <$AudreyModelSong>.title;
|
2024-10-19 11:07:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
2024-11-05 08:29:08 +00:00
|
|
|
styles [
|
|
|
|
"subtitle"
|
|
|
|
]
|
|
|
|
|
2024-10-19 11:07:22 +00:00
|
|
|
focusable: false;
|
2024-10-27 20:39:29 +00:00
|
|
|
xalign: 0;
|
|
|
|
halign: start;
|
2024-10-19 11:07:22 +00:00
|
|
|
hexpand: true;
|
2024-10-27 20:39:29 +00:00
|
|
|
ellipsize: end;
|
|
|
|
max-width-chars: 90;
|
|
|
|
justify: fill;
|
2024-11-05 20:44:20 +00:00
|
|
|
label: bind template.song as <$AudreyModelSong>.artist;
|
2024-10-19 11:07:22 +00:00
|
|
|
}
|
|
|
|
}
|
2024-10-27 20:39:29 +00:00
|
|
|
}
|
2024-10-19 11:07:22 +00:00
|
|
|
|
2024-10-27 20:39:29 +00:00
|
|
|
Label {
|
|
|
|
focusable: false;
|
|
|
|
halign: end;
|
|
|
|
hexpand: true;
|
|
|
|
single-line-mode: true;
|
2024-10-19 11:07:22 +00:00
|
|
|
|
2024-11-05 08:29:08 +00:00
|
|
|
styles [
|
|
|
|
"numeric",
|
|
|
|
"dim-label"
|
|
|
|
]
|
|
|
|
|
2024-11-05 20:44:20 +00:00
|
|
|
label: bind $format_duration(template.song as <$AudreyModelSong>.duration) as <string>;
|
2024-10-27 20:39:29 +00:00
|
|
|
}
|
2024-10-19 12:39:44 +00:00
|
|
|
|
2024-10-27 20:39:29 +00:00
|
|
|
Button {
|
|
|
|
focusable: true;
|
2024-11-05 20:44:20 +00:00
|
|
|
// TODO icon-name: bind $star_button_icon_name (template.song as <$AudreyModelSong>.starred) as <string>;
|
2024-11-05 08:29:08 +00:00
|
|
|
icon-name: bind $star_button_icon_name() as <string>;
|
|
|
|
|
|
|
|
styles [
|
|
|
|
"flat"
|
|
|
|
]
|
|
|
|
|
2024-10-27 21:01:49 +00:00
|
|
|
valign: center;
|
2024-10-27 20:39:29 +00:00
|
|
|
}
|
|
|
|
|
2024-11-05 15:25:17 +00:00
|
|
|
Box {
|
|
|
|
MenuButton {
|
|
|
|
// visible: false;
|
|
|
|
focusable: true;
|
|
|
|
icon-name: "view-more";
|
2024-11-05 08:29:08 +00:00
|
|
|
|
2024-11-05 15:25:17 +00:00
|
|
|
styles [
|
|
|
|
"flat"
|
|
|
|
]
|
2024-11-05 08:29:08 +00:00
|
|
|
|
2024-11-05 15:25:17 +00:00
|
|
|
valign: center;
|
|
|
|
|
|
|
|
popover: PopoverMenu {
|
|
|
|
menu-model: song-menu;
|
|
|
|
};
|
|
|
|
}
|
2024-10-27 20:39:29 +00:00
|
|
|
|
2024-11-05 15:25:17 +00:00
|
|
|
margin-end: 6;
|
2024-10-19 11:07:22 +00:00
|
|
|
}
|
2024-10-19 11:55:25 +00:00
|
|
|
|
|
|
|
DragSource {
|
|
|
|
actions: move;
|
|
|
|
propagation-phase: capture;
|
2024-11-05 08:29:08 +00:00
|
|
|
prepare => $on_drag_prepare() swapped;
|
|
|
|
drag-begin => $on_drag_begin() swapped;
|
2024-10-19 11:55:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DropTarget {
|
|
|
|
actions: move;
|
2024-10-29 14:46:33 +00:00
|
|
|
formats: "AudreyUiPlayQueueSong";
|
2024-10-19 11:55:25 +00:00
|
|
|
preload: true;
|
2024-11-05 08:29:08 +00:00
|
|
|
drop => $on_drop() swapped;
|
2024-10-19 11:55:25 +00:00
|
|
|
}
|
2024-10-19 11:07:22 +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")
|
|
|
|
}
|