2024-10-10 10:12:43 +00:00
|
|
|
using Gtk 4.0;
|
|
|
|
using Adw 1;
|
|
|
|
|
2024-10-13 09:41:01 +00:00
|
|
|
template $UiPlayQueue: Adw.NavigationPage {
|
2024-10-10 10:12:43 +00:00
|
|
|
title: _("Play queue");
|
|
|
|
|
|
|
|
Adw.ToolbarView {
|
|
|
|
[top]
|
2024-10-12 16:35:42 +00:00
|
|
|
Adw.HeaderBar {
|
|
|
|
Button {
|
|
|
|
icon-name: "edit-clear-all";
|
|
|
|
clicked => $clear ();
|
|
|
|
sensitive: bind template.can_clear_all;
|
|
|
|
}
|
|
|
|
}
|
2024-10-10 10:12:43 +00:00
|
|
|
|
|
|
|
ScrolledWindow {
|
2024-10-12 16:35:42 +00:00
|
|
|
ColumnView {
|
|
|
|
styles [ "data-table" ]
|
2024-10-10 20:04:55 +00:00
|
|
|
|
2024-10-12 16:35:42 +00:00
|
|
|
model: SingleSelection selection {
|
2024-10-12 13:12:51 +00:00
|
|
|
model: bind template.songs;
|
2024-10-12 16:35:42 +00:00
|
|
|
selected: bind template.selected_index;
|
|
|
|
selection-changed => $on_song_selected ();
|
2024-10-12 13:12:51 +00:00
|
|
|
};
|
|
|
|
|
2024-10-12 16:35:42 +00:00
|
|
|
ColumnViewColumn {
|
|
|
|
factory: SignalListItemFactory {
|
|
|
|
setup => $delete_cell_setup ();
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
ColumnViewColumn {
|
|
|
|
title: _("Title");
|
|
|
|
expand: true;
|
|
|
|
|
|
|
|
factory: BuilderListItemFactory {
|
|
|
|
template ColumnViewCell {
|
|
|
|
child: Label {
|
|
|
|
halign: start;
|
2024-10-12 20:52:29 +00:00
|
|
|
label: bind template.item as <$Song>.title;
|
|
|
|
tooltip-text: bind template.item as <$Song>.title;
|
2024-10-12 16:35:42 +00:00
|
|
|
ellipsize: end;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
ColumnViewColumn {
|
|
|
|
title: _("Artist");
|
|
|
|
fixed-width: 200;
|
|
|
|
|
|
|
|
factory: BuilderListItemFactory {
|
|
|
|
template ColumnViewCell {
|
|
|
|
child: Label {
|
|
|
|
halign: start;
|
2024-10-12 20:52:29 +00:00
|
|
|
label: bind template.item as <$Song>.artist;
|
|
|
|
tooltip-text: bind template.item as <$Song>.artist;
|
2024-10-12 16:35:42 +00:00
|
|
|
ellipsize: end;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2024-10-10 10:12:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|