mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 11:47:25 +01:00
Add home page header and hook up editors
This commit is contained in:
parent
38613c0063
commit
f49f23a501
10 changed files with 236 additions and 55 deletions
|
|
@ -1,7 +1,7 @@
|
|||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $MusicusHomePage : Adw.NavigationPage {
|
||||
template $MusicusHomePage: Adw.NavigationPage {
|
||||
title: _("Musicus");
|
||||
tag: "home";
|
||||
|
||||
|
|
@ -21,14 +21,65 @@ template $MusicusHomePage : Adw.NavigationPage {
|
|||
maximum-size: 1000;
|
||||
tightening-threshold: 600;
|
||||
|
||||
$MusicusSearchEntry search_entry {
|
||||
activate => $select() swapped;
|
||||
Gtk.Box {
|
||||
orientation: vertical;
|
||||
|
||||
$MusicusSearchEntry search_entry {
|
||||
activate => $select() swapped;
|
||||
}
|
||||
|
||||
Gtk.Box header_box {
|
||||
visible: false;
|
||||
spacing: 12;
|
||||
margin-start: 12;
|
||||
margin-end: 12;
|
||||
margin-top: 24;
|
||||
margin-bottom: 12;
|
||||
|
||||
Gtk.Button {
|
||||
styles [
|
||||
"flat"
|
||||
]
|
||||
|
||||
valign: center;
|
||||
icon-name: "go-previous-symbolic";
|
||||
clicked => $back_button_clicked() swapped;
|
||||
}
|
||||
|
||||
Gtk.Box {
|
||||
orientation: vertical;
|
||||
hexpand: true;
|
||||
|
||||
Gtk.Label title_label {
|
||||
styles [
|
||||
"title-1"
|
||||
]
|
||||
|
||||
xalign: 0.0;
|
||||
}
|
||||
|
||||
Gtk.Label subtitle_label {
|
||||
xalign: 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
Gtk.Button {
|
||||
styles [
|
||||
"flat"
|
||||
]
|
||||
|
||||
valign: center;
|
||||
icon-name: "document-edit-symbolic";
|
||||
clicked => $edit_button_clicked() swapped;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Gtk.Stack stack {
|
||||
Gtk.StackPage {
|
||||
name: "results";
|
||||
|
||||
child: Gtk.ScrolledWindow {
|
||||
hscrollbar-policy: never;
|
||||
|
||||
|
|
@ -44,8 +95,11 @@ template $MusicusHomePage : Adw.NavigationPage {
|
|||
margin-bottom: 68;
|
||||
|
||||
Gtk.Label {
|
||||
styles ["heading"]
|
||||
visible: bind composers_flow_box.visible;
|
||||
styles [
|
||||
"heading"
|
||||
]
|
||||
|
||||
visible: bind composers_flow_box.visible;
|
||||
halign: start;
|
||||
label: _("Composers");
|
||||
}
|
||||
|
|
@ -61,8 +115,11 @@ template $MusicusHomePage : Adw.NavigationPage {
|
|||
}
|
||||
|
||||
Gtk.Label {
|
||||
styles ["heading"]
|
||||
visible: bind performers_flow_box.visible;
|
||||
styles [
|
||||
"heading"
|
||||
]
|
||||
|
||||
visible: bind performers_flow_box.visible;
|
||||
halign: start;
|
||||
label: _("Performers");
|
||||
}
|
||||
|
|
@ -78,8 +135,11 @@ template $MusicusHomePage : Adw.NavigationPage {
|
|||
}
|
||||
|
||||
Gtk.Label {
|
||||
styles ["heading"]
|
||||
visible: bind ensembles_flow_box.visible;
|
||||
styles [
|
||||
"heading"
|
||||
]
|
||||
|
||||
visible: bind ensembles_flow_box.visible;
|
||||
halign: start;
|
||||
label: _("Ensembles");
|
||||
}
|
||||
|
|
@ -95,7 +155,10 @@ template $MusicusHomePage : Adw.NavigationPage {
|
|||
}
|
||||
|
||||
Gtk.Label {
|
||||
styles ["heading"]
|
||||
styles [
|
||||
"heading"
|
||||
]
|
||||
|
||||
visible: bind works_flow_box.visible;
|
||||
halign: start;
|
||||
label: _("Works");
|
||||
|
|
@ -112,7 +175,10 @@ template $MusicusHomePage : Adw.NavigationPage {
|
|||
}
|
||||
|
||||
Gtk.Label {
|
||||
styles ["heading"]
|
||||
styles [
|
||||
"heading"
|
||||
]
|
||||
|
||||
visible: bind recordings_flow_box.visible;
|
||||
halign: start;
|
||||
label: _("Recordings");
|
||||
|
|
@ -129,7 +195,10 @@ template $MusicusHomePage : Adw.NavigationPage {
|
|||
}
|
||||
|
||||
Gtk.Label {
|
||||
styles ["heading"]
|
||||
styles [
|
||||
"heading"
|
||||
]
|
||||
|
||||
visible: bind albums_flow_box.visible;
|
||||
halign: start;
|
||||
label: _("Albums");
|
||||
|
|
@ -148,8 +217,10 @@ template $MusicusHomePage : Adw.NavigationPage {
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
Gtk.StackPage {
|
||||
name: "empty";
|
||||
|
||||
child: Adw.StatusPage {
|
||||
icon-name: "system-search-symbolic";
|
||||
title: _("Nothing Found");
|
||||
|
|
@ -161,7 +232,11 @@ template $MusicusHomePage : Adw.NavigationPage {
|
|||
|
||||
[overlay]
|
||||
Gtk.Button play_button {
|
||||
styles ["pill", "suggested-action"]
|
||||
styles [
|
||||
"pill",
|
||||
"suggested-action"
|
||||
]
|
||||
|
||||
halign: end;
|
||||
valign: end;
|
||||
margin-end: 24;
|
||||
|
|
@ -177,12 +252,14 @@ menu primary_menu {
|
|||
label: _("_Library manager");
|
||||
action: "win.library";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("_Preferences");
|
||||
action: "app.preferences";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("_About Musicus");
|
||||
action: "app.about";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,18 +9,22 @@ template $MusicusPersonEditor: Adw.NavigationPage {
|
|||
Adw.HeaderBar header_bar {}
|
||||
|
||||
Adw.Clamp {
|
||||
Gtk.Label {
|
||||
label: _("Name");
|
||||
xalign: 0;
|
||||
margin-top: 24;
|
||||
Gtk.Box {
|
||||
orientation: vertical;
|
||||
|
||||
styles [
|
||||
"heading"
|
||||
]
|
||||
}
|
||||
Gtk.Label {
|
||||
label: _("Name");
|
||||
xalign: 0;
|
||||
margin-top: 24;
|
||||
|
||||
$MusicusTranslationEditor name_editor {
|
||||
margin-start: 12;
|
||||
styles [
|
||||
"heading"
|
||||
]
|
||||
}
|
||||
|
||||
$MusicusTranslationEditor name_editor {
|
||||
margin-top: 12;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,5 +35,12 @@ template $MusicusRecordingTile : Gtk.FlowBoxChild {
|
|||
wrap: true;
|
||||
}
|
||||
}
|
||||
|
||||
Gtk.Button {
|
||||
styles ["flat"]
|
||||
valign: start;
|
||||
margin-top: 12;
|
||||
icon-name: "view-more-symbolic";
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue