mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 11:47:25 +01:00
New search page
This commit is contained in:
parent
a6e0935df8
commit
cff489f43e
12 changed files with 830 additions and 793 deletions
278
data/ui/search_page.blp
Normal file
278
data/ui/search_page.blp
Normal file
|
|
@ -0,0 +1,278 @@
|
|||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $MusicusSearchPage: Adw.NavigationPage {
|
||||
title: _("Musicus");
|
||||
|
||||
Adw.ToolbarView {
|
||||
[top]
|
||||
Adw.HeaderBar header_bar {
|
||||
[end]
|
||||
MenuButton {
|
||||
icon-name: "open-menu-symbolic";
|
||||
menu-model: primary_menu;
|
||||
}
|
||||
}
|
||||
|
||||
Gtk.ScrolledWindow scrolled_window {
|
||||
Adw.Clamp {
|
||||
maximum-size: 1000;
|
||||
tightening-threshold: 600;
|
||||
|
||||
Gtk.Box {
|
||||
orientation: vertical;
|
||||
margin-bottom: 24;
|
||||
margin-start: 12;
|
||||
margin-end: 12;
|
||||
|
||||
Gtk.Box header_box {
|
||||
visible: false;
|
||||
spacing: 12;
|
||||
margin-top: 24;
|
||||
|
||||
Gtk.Box {
|
||||
orientation: vertical;
|
||||
hexpand: true;
|
||||
|
||||
Gtk.Label title_label {
|
||||
wrap: true;
|
||||
xalign: 0.0;
|
||||
|
||||
styles [
|
||||
"title-1",
|
||||
]
|
||||
}
|
||||
|
||||
Gtk.Label subtitle_label {
|
||||
wrap: true;
|
||||
xalign: 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
Gtk.Button {
|
||||
icon-name: "document-edit-symbolic";
|
||||
valign: center;
|
||||
clicked => $edit_button_clicked() swapped;
|
||||
|
||||
styles [
|
||||
"flat",
|
||||
]
|
||||
}
|
||||
|
||||
Gtk.Button {
|
||||
icon-name: "media-playback-start-symbolic";
|
||||
label: _("_Play");
|
||||
use-underline: true;
|
||||
valign: center;
|
||||
clicked => $play_button_clicked() swapped;
|
||||
|
||||
styles [
|
||||
"pill",
|
||||
"suggested-action",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Gtk.SearchEntry search_entry {
|
||||
placeholder-text: _("Enter composers, performers, works…");
|
||||
margin-top: 24;
|
||||
activate => $select() swapped;
|
||||
}
|
||||
|
||||
Gtk.Stack stack {
|
||||
Gtk.StackPage {
|
||||
name: "results";
|
||||
|
||||
child: Gtk.Box {
|
||||
orientation: vertical;
|
||||
margin-top: 24;
|
||||
|
||||
Gtk.FlowBox programs_flow_box {
|
||||
margin-top: 12;
|
||||
margin-bottom: 24;
|
||||
column-spacing: 12;
|
||||
row-spacing: 12;
|
||||
homogeneous: true;
|
||||
selection-mode: none;
|
||||
child-activated => $program_selected() swapped;
|
||||
}
|
||||
|
||||
Gtk.Label {
|
||||
styles [
|
||||
"heading",
|
||||
]
|
||||
|
||||
visible: bind composers_flow_box.visible;
|
||||
halign: start;
|
||||
label: _("Composers");
|
||||
}
|
||||
|
||||
Gtk.FlowBox composers_flow_box {
|
||||
margin-top: 12;
|
||||
margin-bottom: 24;
|
||||
column-spacing: 12;
|
||||
row-spacing: 12;
|
||||
homogeneous: true;
|
||||
selection-mode: none;
|
||||
child-activated => $tile_selected() swapped;
|
||||
}
|
||||
|
||||
Gtk.Label {
|
||||
styles [
|
||||
"heading",
|
||||
]
|
||||
|
||||
visible: bind performers_flow_box.visible;
|
||||
halign: start;
|
||||
label: _("Performers");
|
||||
}
|
||||
|
||||
Gtk.FlowBox performers_flow_box {
|
||||
margin-top: 12;
|
||||
margin-bottom: 24;
|
||||
column-spacing: 12;
|
||||
row-spacing: 12;
|
||||
homogeneous: true;
|
||||
selection-mode: none;
|
||||
child-activated => $tile_selected() swapped;
|
||||
}
|
||||
|
||||
Gtk.Label {
|
||||
styles [
|
||||
"heading",
|
||||
]
|
||||
|
||||
visible: bind ensembles_flow_box.visible;
|
||||
halign: start;
|
||||
label: _("Ensembles");
|
||||
}
|
||||
|
||||
Gtk.FlowBox ensembles_flow_box {
|
||||
margin-top: 12;
|
||||
margin-bottom: 24;
|
||||
column-spacing: 12;
|
||||
row-spacing: 12;
|
||||
homogeneous: true;
|
||||
selection-mode: none;
|
||||
child-activated => $tile_selected() swapped;
|
||||
}
|
||||
|
||||
Gtk.Label {
|
||||
styles [
|
||||
"heading",
|
||||
]
|
||||
|
||||
visible: bind instruments_flow_box.visible;
|
||||
halign: start;
|
||||
label: _("Instruments");
|
||||
}
|
||||
|
||||
Gtk.FlowBox instruments_flow_box {
|
||||
margin-top: 12;
|
||||
margin-bottom: 24;
|
||||
column-spacing: 12;
|
||||
row-spacing: 12;
|
||||
homogeneous: true;
|
||||
selection-mode: none;
|
||||
child-activated => $tile_selected() swapped;
|
||||
}
|
||||
|
||||
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;
|
||||
child-activated => $tile_selected() swapped;
|
||||
}
|
||||
|
||||
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;
|
||||
child-activated => $recording_selected() swapped;
|
||||
}
|
||||
|
||||
Gtk.Label {
|
||||
styles [
|
||||
"heading",
|
||||
]
|
||||
|
||||
visible: bind albums_flow_box.visible;
|
||||
halign: start;
|
||||
label: _("Albums");
|
||||
}
|
||||
|
||||
Gtk.FlowBox albums_flow_box {
|
||||
margin-top: 12;
|
||||
margin-bottom: 24;
|
||||
column-spacing: 12;
|
||||
row-spacing: 12;
|
||||
homogeneous: true;
|
||||
selection-mode: none;
|
||||
child-activated => $album_selected() swapped;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Gtk.StackPage {
|
||||
name: "empty";
|
||||
|
||||
child: Adw.StatusPage {
|
||||
icon-name: "system-search-symbolic";
|
||||
title: _("Nothing Found");
|
||||
description: _("Try a different search.");
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
menu primary_menu {
|
||||
item {
|
||||
label: _("_Import music");
|
||||
action: "win.import";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("_Library manager");
|
||||
action: "win.library";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("_Preferences");
|
||||
action: "app.preferences";
|
||||
}
|
||||
|
||||
item {
|
||||
label: _("_About Musicus");
|
||||
action: "app.about";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue