2024-11-17 10:26:40 +00:00
|
|
|
using Gtk 4.0;
|
|
|
|
using Adw 1;
|
|
|
|
|
|
|
|
template $AudreyUiAlbumCarousel: Adw.Bin {
|
2024-11-25 19:18:10 +00:00
|
|
|
styles [
|
|
|
|
"album-carousel"
|
|
|
|
]
|
2024-11-17 10:26:40 +00:00
|
|
|
|
|
|
|
child: Box {
|
|
|
|
orientation: vertical;
|
|
|
|
|
|
|
|
Box {
|
|
|
|
margin-start: 12;
|
|
|
|
spacing: 6;
|
|
|
|
height-request: 42;
|
|
|
|
|
|
|
|
Label {
|
|
|
|
label: bind template.title;
|
2024-11-25 19:18:10 +00:00
|
|
|
|
|
|
|
styles [
|
|
|
|
"title-2"
|
|
|
|
]
|
2024-11-17 10:26:40 +00:00
|
|
|
}
|
|
|
|
|
2024-11-25 19:18:10 +00:00
|
|
|
Button {
|
2024-11-17 10:26:40 +00:00
|
|
|
valign: center;
|
|
|
|
icon-name: "view-refresh-symbolic";
|
2024-11-25 19:18:10 +00:00
|
|
|
|
|
|
|
styles [
|
|
|
|
"circular",
|
|
|
|
"flat"
|
|
|
|
]
|
2024-11-17 10:26:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Box {
|
|
|
|
halign: end;
|
|
|
|
hexpand: true;
|
|
|
|
valign: center;
|
|
|
|
|
2024-11-25 19:18:10 +00:00
|
|
|
Button {
|
2024-11-17 10:26:40 +00:00
|
|
|
icon-name: "go-previous-symbolic";
|
2024-11-25 19:18:10 +00:00
|
|
|
|
|
|
|
styles [
|
|
|
|
"flat"
|
|
|
|
]
|
2024-11-17 10:26:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
icon-name: "go-next-symbolic";
|
2024-11-25 19:18:10 +00:00
|
|
|
|
|
|
|
styles [
|
|
|
|
"flat"
|
|
|
|
]
|
2024-11-17 10:26:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-11-25 19:18:10 +00:00
|
|
|
Separator {
|
|
|
|
styles [
|
|
|
|
"spacer"
|
|
|
|
]
|
|
|
|
}
|
2024-11-17 10:26:40 +00:00
|
|
|
|
|
|
|
ScrolledWindow {
|
|
|
|
hexpand: true;
|
|
|
|
vscrollbar-policy: never;
|
|
|
|
hscrollbar-policy: external;
|
|
|
|
|
|
|
|
child: ListView {
|
|
|
|
orientation: horizontal;
|
|
|
|
|
|
|
|
styles [
|
|
|
|
"albums"
|
|
|
|
]
|
|
|
|
|
|
|
|
single-click-activate: true;
|
|
|
|
|
|
|
|
model: NoSelection {
|
|
|
|
model: bind template.model;
|
|
|
|
};
|
|
|
|
|
|
|
|
factory: BuilderListItemFactory {
|
|
|
|
template ListItem {
|
|
|
|
child: Box {
|
2024-11-25 19:18:10 +00:00
|
|
|
styles [
|
|
|
|
"album"
|
|
|
|
]
|
|
|
|
|
2024-11-17 10:26:40 +00:00
|
|
|
orientation: vertical;
|
|
|
|
margin-bottom: 6;
|
|
|
|
spacing: 6;
|
|
|
|
|
|
|
|
Image {
|
|
|
|
icon-name: "media-optical-cd";
|
|
|
|
pixel-size: 160;
|
|
|
|
halign: center;
|
|
|
|
hexpand: false;
|
|
|
|
}
|
|
|
|
|
|
|
|
Box {
|
2024-11-25 19:18:10 +00:00
|
|
|
styles [
|
|
|
|
"labels"
|
|
|
|
]
|
|
|
|
|
2024-11-17 10:26:40 +00:00
|
|
|
orientation: vertical;
|
|
|
|
homogeneous: true;
|
|
|
|
|
|
|
|
Label {
|
2024-11-24 18:53:57 +00:00
|
|
|
label: bind template.item as <$AudreyModelAlbum>.name;
|
2024-11-17 10:26:40 +00:00
|
|
|
ellipsize: end;
|
|
|
|
xalign: 0;
|
|
|
|
margin-start: 6;
|
|
|
|
|
|
|
|
styles [
|
|
|
|
"heading"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
2024-11-24 18:53:57 +00:00
|
|
|
label: bind template.item as <$AudreyModelAlbum>.artist;
|
2024-11-17 10:26:40 +00:00
|
|
|
ellipsize: end;
|
|
|
|
xalign: 0;
|
|
|
|
margin-start: 6;
|
|
|
|
|
|
|
|
styles [
|
|
|
|
"caption"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|