musicus/data/ui/search_page.blp

308 lines
7.6 KiB
Text
Raw Normal View History

2023-09-20 13:49:02 +02:00
using Gtk 4.0;
using Adw 1;
2025-03-02 08:03:31 +01:00
template $MusicusSearchPage: Adw.NavigationPage {
2023-09-20 13:49:02 +02:00
title: _("Musicus");
2025-03-02 08:03:31 +01:00
Adw.ToolbarView {
[top]
Adw.HeaderBar header_bar {
[end]
MenuButton {
icon-name: "open-menu-symbolic";
menu-model: primary_menu;
2023-09-20 13:49:02 +02:00
}
2025-03-02 08:03:31 +01:00
}
2023-09-20 13:49:02 +02:00
2025-03-02 08:03:31 +01:00
Gtk.ScrolledWindow scrolled_window {
2023-09-21 17:19:31 +02:00
Adw.Clamp {
maximum-size: 1000;
tightening-threshold: 600;
2023-09-20 13:49:02 +02:00
Gtk.Box {
orientation: vertical;
2025-03-02 08:03:31 +01:00
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;
2025-03-08 08:35:15 +01:00
valign: center;
Gtk.Label title_label {
2025-03-02 08:03:31 +01:00
wrap: true;
xalign: 0.0;
styles [
2025-03-02 08:03:31 +01:00
"title-1",
]
}
Gtk.Label subtitle_label {
2025-03-02 08:03:31 +01:00
wrap: true;
xalign: 0.0;
}
}
2025-03-08 08:35:15 +01:00
Gtk.MenuButton {
icon-name: "view-more-symbolic";
menu-model: item_menu;
2025-03-02 08:03:31 +01:00
valign: center;
styles [
2025-03-02 08:03:31 +01:00
"flat",
]
2025-03-02 08:03:31 +01:00
}
2025-03-02 08:03:31 +01:00
Gtk.Button {
label: _("_Play");
2025-03-08 08:35:15 +01:00
tooltip-text: _("Play this as a program");
2025-03-02 08:03:31 +01:00
use-underline: true;
valign: center;
2025-03-02 08:03:31 +01:00
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;
2023-09-20 13:49:02 +02:00
styles [
"rounded-entry"
]
2025-03-02 08:03:31 +01:00
}
2023-09-20 13:49:02 +02:00
2025-03-02 08:03:31 +01:00
Gtk.Stack stack {
2025-03-23 14:57:43 +01:00
vhomogeneous: false;
2025-03-02 08:03:31 +01:00
Gtk.StackPage {
name: "results";
2023-09-20 13:49:02 +02:00
2025-03-02 08:03:31 +01:00
child: Gtk.Box {
orientation: vertical;
margin-top: 24;
2023-09-20 13:49:02 +02:00
2024-04-01 18:43:00 +02:00
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 [
2025-03-02 08:03:31 +01:00
"heading",
]
visible: bind composers_flow_box.visible;
halign: start;
2023-10-08 15:11:47 +02:00
label: _("Composers");
}
2023-09-21 17:19:31 +02:00
2023-10-08 15:11:47 +02:00
Gtk.FlowBox composers_flow_box {
margin-top: 12;
margin-bottom: 24;
column-spacing: 12;
row-spacing: 12;
homogeneous: true;
selection-mode: none;
2023-10-11 12:04:49 +02:00
child-activated => $tile_selected() swapped;
2023-10-08 15:11:47 +02:00
}
Gtk.Label {
styles [
2025-03-02 08:03:31 +01:00
"heading",
]
visible: bind performers_flow_box.visible;
2023-10-08 15:11:47 +02:00
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;
2023-10-11 12:04:49 +02:00
child-activated => $tile_selected() swapped;
}
Gtk.Label {
styles [
2025-03-02 08:03:31 +01:00
"heading",
]
visible: bind ensembles_flow_box.visible;
halign: start;
label: _("Ensembles");
}
2023-09-20 13:49:02 +02:00
Gtk.FlowBox ensembles_flow_box {
margin-top: 12;
margin-bottom: 24;
column-spacing: 12;
row-spacing: 12;
homogeneous: true;
selection-mode: none;
2023-10-11 12:04:49 +02:00
child-activated => $tile_selected() swapped;
}
2025-03-01 20:54:22 +01:00
Gtk.Label {
styles [
2025-03-02 08:03:31 +01:00
"heading",
2025-03-01 20:54:22 +01:00
]
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 [
2025-03-02 08:03:31 +01:00
"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;
2023-10-11 12:04:49 +02:00
child-activated => $tile_selected() swapped;
}
Gtk.Label {
styles [
2025-03-02 08:03:31 +01:00
"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;
2023-10-11 12:04:49 +02:00
child-activated => $recording_selected() swapped;
}
2024-06-05 13:26:47 +02:00
Gtk.Label {
styles [
2025-03-02 08:03:31 +01:00
"heading",
]
2024-06-05 13:26:47 +02:00
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;
}
2025-03-02 08:03:31 +01:00
};
2023-09-21 17:19:31 +02:00
}
2025-03-02 08:03:31 +01:00
Gtk.StackPage {
name: "empty";
2025-03-02 08:03:31 +01:00
child: Adw.StatusPage {
icon-name: "system-search-symbolic";
title: _("Nothing Found");
description: _("Try a different search.");
2025-03-23 14:57:43 +01:00
vexpand: true;
2025-03-02 08:03:31 +01:00
};
}
}
2023-09-20 13:49:02 +02:00
}
}
}
}
}
menu primary_menu {
2025-02-09 10:00:46 +01:00
item {
label: _("_Import music");
action: "win.import";
}
2023-11-07 16:21:47 +01:00
item {
label: _("_Library manager");
action: "win.library";
}
2023-09-20 13:49:02 +02:00
item {
label: _("_Preferences");
2025-03-16 14:06:57 +01:00
action: "win.preferences";
2023-09-20 13:49:02 +02:00
}
2023-09-20 13:49:02 +02:00
item {
label: _("_About Musicus");
action: "app.about";
}
}
2025-03-08 08:35:15 +01:00
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";
}
}
}