audrey/resources/window.blp

201 lines
5 KiB
Text
Raw Normal View History

2024-10-10 10:12:43 +00:00
using Gtk 4.0;
using Adw 1;
2024-10-29 14:46:33 +00:00
template $AudreyUiWindow: Adw.ApplicationWindow {
2024-10-12 20:52:29 +00:00
title: _("audrey");
2024-10-10 10:12:43 +00:00
default-width: 800;
default-height: 600;
2024-10-20 16:25:40 +00:00
Adw.ToolbarView {
top-bar-style: raised;
bottom-bar-style: raised;
[top]
Adw.HeaderBar {
[start]
Button {
icon-name: "media-playlist-shuffle";
sensitive: bind template.can_click_shuffle_all;
2024-11-05 08:29:08 +00:00
clicked => $shuffle_all() swapped;
2024-10-10 10:12:43 +00:00
}
2024-10-20 16:25:40 +00:00
title-widget: Adw.ViewSwitcher {
stack: stack;
policy: wide;
};
2024-10-20 15:43:06 +00:00
2024-10-20 16:25:40 +00:00
[end]
Button {
icon-name: "applications-system";
2024-11-05 08:29:08 +00:00
clicked => $show_setup_dialog() swapped;
2024-10-20 16:25:40 +00:00
}
}
2024-10-20 15:43:06 +00:00
2024-10-20 16:25:40 +00:00
content: Adw.ViewStack stack {
vexpand: true;
2024-11-05 08:29:08 +00:00
2024-10-20 16:25:40 +00:00
Adw.ViewStackPage {
icon-name: "media-optical-cd";
title: _("Albums");
child: Adw.NavigationView {
Adw.NavigationPage {
title: _("Albums");
vexpand: true;
child: Adw.ToolbarView {
[top]
CenterBox {
2024-11-05 08:29:08 +00:00
styles [
"toolbar"
]
2024-10-20 16:25:40 +00:00
2024-10-28 08:47:27 +00:00
[start]
DropDown {
selected: 0;
2024-11-05 08:29:08 +00:00
2024-10-28 08:47:27 +00:00
model: StringList {
strings [
_("Random"),
_("Recently added"),
_("Most played"),
_("Recently played"),
_("Starred"),
_("Name"),
_("Artist"),
]
};
}
2024-10-20 16:25:40 +00:00
[center]
SearchEntry {
placeholder-text: _("Search...");
}
2024-10-20 15:43:06 +00:00
2024-10-20 16:25:40 +00:00
[end]
Box {
Button {
icon-name: "view-refresh";
2024-10-20 15:43:06 +00:00
}
}
2024-10-20 16:25:40 +00:00
}
2024-10-20 15:43:06 +00:00
2024-10-20 16:25:40 +00:00
ScrolledWindow {
vexpand: true;
2024-11-05 08:29:08 +00:00
2024-11-07 20:54:01 +00:00
GridView {
styles [ "albums" ]
single-click-activate: true;
model: NoSelection {
model: bind template.albums-model;
};
factory: BuilderListItemFactory {
template ListItem {
child: Box {
orientation: vertical;
margin-bottom: 6;
Image {
icon-name: "media-optical-cd";
pixel-size: 160;
halign: center;
hexpand: false;
styles [
"frame"
]
}
Label {
label: bind template.item as <$AudreyModelAlbum>.name;
ellipsize: end;
styles [
"heading"
]
}
Label {
label: bind template.item as <$AudreyModelAlbum>.artist;
ellipsize: end;
styles [
"caption"
]
}
};
}
};
}
2024-10-20 16:25:40 +00:00
}
};
}
};
}
Adw.ViewStackPage {
icon-name: "media-playback-start";
title: _("Play queue");
name: "play-queue";
2024-10-20 16:25:40 +00:00
child: Box {
name: "play-queue-page";
homogeneous: true;
2024-10-10 10:12:43 +00:00
2024-10-20 16:25:40 +00:00
Adw.Clamp {
halign: center;
margin-top: 24;
margin-bottom: 24;
margin-start: 24;
margin-end: 24;
2024-10-20 14:15:22 +00:00
2024-10-20 16:25:40 +00:00
Picture {
valign: center;
2024-11-05 08:29:08 +00:00
styles [
"frame"
]
2024-10-20 14:15:22 +00:00
halign: center;
2024-10-20 16:25:40 +00:00
paintable: bind template.playing_cover_art;
2024-10-20 14:15:22 +00:00
}
2024-10-20 16:25:40 +00:00
}
2024-10-20 14:15:22 +00:00
2024-10-29 14:46:33 +00:00
$AudreyUiPlayQueue play_queue {
2024-10-20 16:25:40 +00:00
hexpand: true;
halign: fill;
margin-top: 48;
margin-bottom: 48;
margin-start: 24;
margin-end: 24;
2024-10-20 14:15:22 +00:00
2024-11-05 08:29:08 +00:00
styles [
"frame"
]
2024-11-04 11:31:43 +00:00
model: bind template.playlist_model;
playlist-pos: bind template.playlist-pos;
2024-11-05 08:29:08 +00:00
// playbin: bind template.playbin;
2024-10-20 16:25:40 +00:00
}
};
}
};
2024-10-10 10:12:43 +00:00
2024-10-20 16:25:40 +00:00
[bottom]
2024-10-29 14:46:33 +00:00
$AudreyUiPlaybar playbar {
2024-10-19 15:04:56 +00:00
song: bind template.song;
2024-11-05 09:01:07 +00:00
playing-cover-art: bind template.playing-cover-art;
show-cover-art: bind $show_playbar_cover_art(stack.visible-child-name) as <bool>;
2024-11-04 11:31:43 +00:00
volume: bind template.volume bidirectional;
mute: bind template.mute bidirectional;
pause: bind template.pause bidirectional;
2024-11-04 12:22:25 +00:00
position: bind template.time-pos;
2024-11-05 09:01:07 +00:00
duration: bind template.duration;
2024-11-04 12:43:30 +00:00
idle-active: bind template.idle-active;
2024-11-05 09:01:07 +00:00
playlist-count: bind template.playlist-count;
2024-10-10 10:12:43 +00:00
}
2024-10-20 16:25:40 +00:00
}
2024-10-10 10:12:43 +00:00
}