musicus/data/ui/search_page.blp
2025-05-16 10:19:50 +03:00

309 lines
7.7 KiB
Text

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;
valign: center;
Gtk.Label title_label {
wrap: true;
xalign: 0.0;
styles [
"title-1",
]
}
Gtk.Label subtitle_label {
wrap: true;
xalign: 0.0;
}
}
Gtk.MenuButton {
icon-name: "view-more-symbolic";
menu-model: item_menu;
valign: center;
styles [
"flat",
]
}
Gtk.Button {
label: _("_Play");
tooltip-text: _("Play this as a program");
use-underline: true;
valign: center;
clicked => $play_button_clicked() swapped;
styles [
"pill",
"suggested-action",
]
}
}
Adw.Clamp {
Gtk.SearchEntry search_entry {
placeholder-text: _("Enter composers, performers, works…");
margin-top: 24;
activate => $select() swapped;
styles [
"rounded-entry"
]
}
}
Gtk.Stack stack {
vhomogeneous: false;
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.");
vexpand: true;
};
}
}
}
}
}
}
}
menu primary_menu {
item {
label: _("_Import music");
action: "win.import";
}
item {
label: _("_Library manager");
action: "win.library";
}
item {
label: _("_Preferences");
action: "win.preferences";
}
item {
label: _("_About Musicus");
action: "app.about";
}
}
menu item_menu {
section {
item {
label: _("_Add to playlist");
action: "search.add-to-playlist";
}
}
section {
item {
label: _("_Edit item");
action: "search.edit";
}
item {
label: _("_Delete item");
action: "search.delete";
}
}
}