Add play button and player bar

This commit is contained in:
Elias Projahn 2023-09-21 17:19:31 +02:00
parent 3ef0fe960b
commit e96694d584
6 changed files with 166 additions and 80 deletions

View file

@ -5,92 +5,107 @@ template $MusicusHomePage : Adw.NavigationPage {
title: _("Musicus");
tag: "home";
Adw.ToolbarView {
[top]
Adw.HeaderBar header_bar {
[end]
MenuButton {
icon-name: "open-menu-symbolic";
menu-model: primary_menu;
}
}
[top]
Adw.Clamp {
maximum-size: 1000;
tightening-threshold: 600;
Adw.Bin {
styles ["searchbar"]
Gtk.SearchEntry search_entry {
placeholder-text: _("Enter composers, performers, works…");
Gtk.Overlay {
Adw.ToolbarView {
[top]
Adw.HeaderBar header_bar {
[end]
MenuButton {
icon-name: "open-menu-symbolic";
menu-model: primary_menu;
}
}
}
Gtk.ScrolledWindow {
hscrollbar-policy: never;
[top]
Adw.Clamp {
maximum-size: 1000;
tightening-threshold: 600;
Gtk.Box {
orientation: vertical;
margin-start: 12;
margin-end: 12;
margin-top: 24;
Adw.Bin {
styles ["searchbar"]
Gtk.Label {
styles ["heading"]
visible: bind persons_flow_box.visible;
halign: start;
label: _("Composers and performers");
}
Gtk.FlowBox persons_flow_box {
margin-top: 12;
margin-bottom: 24;
column-spacing: 14;
row-spacing: 14;
homogeneous: true;
selection-mode: none;
}
Gtk.Label {
styles ["heading"]
visible: bind works_flow_box.visible;
halign: start;
label: _("Works");
}
Gtk.FlowBox works_flow_box {
margin-top: 12;
margin-bottom: 24;
column-spacing: 14;
row-spacing: 14;
homogeneous: true;
selection-mode: none;
}
Gtk.Label {
styles ["heading"]
visible: bind recordings_flow_box.visible;
halign: start;
label: _("Recordings");
}
Gtk.FlowBox recordings_flow_box {
margin-top: 12;
margin-bottom: 24;
column-spacing: 14;
row-spacing: 14;
homogeneous: true;
selection-mode: none;
Gtk.SearchEntry search_entry {
placeholder-text: _("Enter composers, performers, works…");
search-changed => $search() swapped;
}
}
}
Gtk.ScrolledWindow {
hscrollbar-policy: never;
Adw.Clamp {
maximum-size: 1000;
tightening-threshold: 600;
Gtk.Box {
orientation: vertical;
margin-start: 12;
margin-end: 12;
margin-top: 24;
margin-bottom: 68;
Gtk.Label {
styles ["heading"]
visible: bind persons_flow_box.visible;
halign: start;
label: _("Composers and performers");
}
Gtk.FlowBox persons_flow_box {
margin-top: 12;
margin-bottom: 24;
column-spacing: 12;
row-spacing: 12;
homogeneous: true;
selection-mode: none;
}
Gtk.Label {
styles ["heading"]
visible: bind works_flow_box.visible;
halign: start;
label: _("Works");
}
Gtk.FlowBox works_flow_box {
margin-top: 12;
margin-bottom: 24;
column-spacing: 12;
row-spacing: 12;
homogeneous: true;
selection-mode: none;
}
Gtk.Label {
styles ["heading"]
visible: bind recordings_flow_box.visible;
halign: start;
label: _("Recordings");
}
Gtk.FlowBox recordings_flow_box {
margin-top: 12;
margin-bottom: 24;
column-spacing: 12;
row-spacing: 12;
homogeneous: true;
selection-mode: none;
}
}
}
}
}
[overlay]
Gtk.Button play_button {
styles ["pill", "suggested-action"]
halign: end;
valign: end;
margin-end: 24;
margin-bottom: 24;
label: _("Play music");
clicked => $play() swapped;
}
}
}