Refactor module layout

This commit is contained in:
Elias Projahn 2025-03-01 09:57:01 +01:00
parent e59052a362
commit 5956b7ff15
70 changed files with 757 additions and 841 deletions

73
data/ui/editor/album.blp Normal file
View file

@ -0,0 +1,73 @@
using Gtk 4.0;
using Adw 1;
template $MusicusAlbumEditor: Adw.NavigationPage {
title: _("Album");
Adw.ToolbarView {
[top]
Adw.HeaderBar header_bar {}
Adw.Clamp {
Gtk.Box {
orientation: vertical;
Gtk.Label {
label: _("Name");
xalign: 0;
margin-top: 24;
styles [
"heading"
]
}
$MusicusTranslationEditor name_editor {
margin-top: 12;
}
Gtk.Label {
label: _("Recordings");
xalign: 0;
margin-top: 24;
styles [
"heading"
]
}
Gtk.ListBox recordings_list {
selection-mode: none;
margin-top: 12;
margin-bottom: 24;
styles [
"boxed-list"
]
Adw.ButtonRow {
title: _("Add _recording");
start-icon-name: "list-add-symbolic";
use-underline: true;
activated => $select_recording() swapped;
}
}
Gtk.ListBox {
selection-mode: none;
margin-top: 24;
styles [
"boxed-list"
]
Adw.ButtonRow save_row {
title: _("_Create album");
use-underline: true;
activated => $save() swapped;
}
}
}
}
}
}

View file

@ -0,0 +1,46 @@
using Gtk 4.0;
using Adw 1;
template $MusicusEnsembleEditor: Adw.NavigationPage {
title: _("Ensemble");
Adw.ToolbarView {
[top]
Adw.HeaderBar header_bar {}
Adw.Clamp {
Gtk.Box {
orientation: vertical;
Gtk.Label {
label: _("Name");
xalign: 0;
margin-top: 24;
styles [
"heading"
]
}
$MusicusTranslationEditor name_editor {
margin-top: 12;
}
Gtk.ListBox {
selection-mode: none;
margin-top: 24;
styles [
"boxed-list"
]
Adw.ButtonRow save_row {
title: _("_Create ensemble");
use-underline: true;
activated => $save() swapped;
}
}
}
}
}
}

View file

@ -0,0 +1,46 @@
using Gtk 4.0;
using Adw 1;
template $MusicusInstrumentEditor: Adw.NavigationPage {
title: _("Instrument");
Adw.ToolbarView {
[top]
Adw.HeaderBar header_bar {}
Adw.Clamp {
Gtk.Box {
orientation: vertical;
Gtk.Label {
label: _("Name");
xalign: 0;
margin-top: 24;
styles [
"heading"
]
}
$MusicusTranslationEditor name_editor {
margin-top: 12;
}
Gtk.ListBox {
selection-mode: none;
margin-top: 24;
styles [
"boxed-list"
]
Adw.ButtonRow save_row {
title: _("_Create instrument");
use-underline: true;
activated => $save() swapped;
}
}
}
}
}
}

46
data/ui/editor/person.blp Normal file
View file

@ -0,0 +1,46 @@
using Gtk 4.0;
using Adw 1;
template $MusicusPersonEditor: Adw.NavigationPage {
title: _("Person");
Adw.ToolbarView {
[top]
Adw.HeaderBar header_bar {}
Adw.Clamp {
Gtk.Box {
orientation: vertical;
Gtk.Label {
label: _("Name");
xalign: 0;
margin-top: 24;
styles [
"heading"
]
}
$MusicusTranslationEditor name_editor {
margin-top: 12;
}
Gtk.ListBox {
selection-mode: none;
margin-top: 24;
styles [
"boxed-list"
]
Adw.ButtonRow save_row {
title: _("_Create person");
use-underline: true;
activated => $save() swapped;
}
}
}
}
}
}

View file

@ -0,0 +1,135 @@
using Gtk 4.0;
using Adw 1;
template $MusicusRecordingEditor: Adw.NavigationPage {
title: _("Recording");
Adw.ToolbarView {
[top]
Adw.HeaderBar header_bar {}
Gtk.ScrolledWindow {
Adw.Clamp {
Gtk.Box {
orientation: vertical;
margin-bottom: 24;
margin-start: 12;
margin-end: 12;
Gtk.Label {
label: _("Recording");
xalign: 0;
margin-top: 24;
styles [
"heading",
]
}
Gtk.ListBox {
selection-mode: none;
margin-top: 12;
styles [
"boxed-list",
]
Adw.ActionRow work_row {
title: _("Select _work");
use-underline: true;
activatable: true;
activated => $select_work() swapped;
[prefix]
Gtk.Box select_work_box {
Gtk.Image {
icon-name: "document-edit-symbolic";
}
}
}
Adw.SpinRow year_row {
title: _("_Year");
use-underline: true;
adjustment: Gtk.Adjustment {
lower: 0;
upper: 3000;
value: 2000;
step-increment: 1;
page-increment: 10;
};
}
}
Gtk.Label {
label: _("Performers");
xalign: 0;
margin-top: 24;
styles [
"heading",
]
}
Gtk.ListBox performer_list {
selection-mode: none;
margin-top: 12;
styles [
"boxed-list",
]
Adw.ButtonRow {
title: _("Add _performer");
start-icon-name: "list-add-symbolic";
use-underline: true;
activated => $select_person() swapped;
}
}
Gtk.Label {
label: _("Ensembles");
xalign: 0;
margin-top: 24;
styles [
"heading",
]
}
Gtk.ListBox ensemble_list {
selection-mode: none;
margin-top: 12;
styles [
"boxed-list",
]
Adw.ButtonRow {
title: _("Add _ensemble");
use-underline: true;
start-icon-name: "list-add-symbolic";
activated => $select_ensemble() swapped;
}
}
Gtk.ListBox {
selection-mode: none;
margin-top: 24;
styles [
"boxed-list",
]
Adw.ButtonRow save_row {
title: _("_Create recording");
use-underline: true;
activated => $save() swapped;
}
}
}
}
}
}
}

View file

@ -0,0 +1,33 @@
using Gtk 4.0;
using Adw 1;
template $MusicusRecordingEditorEnsembleRow: Adw.ActionRow {
Gtk.Button {
icon-name: "user-trash-symbolic";
valign: center;
clicked => $remove() swapped;
styles [
"flat"
]
}
Gtk.Button {
valign: center;
clicked => $open_role_popover() swapped;
styles [
"flat"
]
Gtk.Box role_box {
spacing: 6;
Gtk.Label role_label {}
Gtk.Image {
icon-name: "pan-down-symbolic";
}
}
}
}

View file

@ -0,0 +1,33 @@
using Gtk 4.0;
using Adw 1;
template $MusicusRecordingEditorPerformerRow: Adw.ActionRow {
Gtk.Button {
icon-name: "user-trash-symbolic";
valign: center;
clicked => $remove() swapped;
styles [
"flat"
]
}
Gtk.Button {
valign: center;
clicked => $open_role_popover() swapped;
styles [
"flat"
]
Gtk.Box role_box {
spacing: 6;
Gtk.Label role_label {}
Gtk.Image {
icon-name: "pan-down-symbolic";
}
}
}
}

46
data/ui/editor/role.blp Normal file
View file

@ -0,0 +1,46 @@
using Gtk 4.0;
using Adw 1;
template $MusicusRoleEditor: Adw.NavigationPage {
title: _("Role");
Adw.ToolbarView {
[top]
Adw.HeaderBar header_bar {}
Adw.Clamp {
Gtk.Box {
orientation: vertical;
Gtk.Label {
label: _("Name");
xalign: 0;
margin-top: 24;
styles [
"heading"
]
}
$MusicusTranslationEditor name_editor {
margin-top: 12;
}
Gtk.ListBox {
selection-mode: none;
margin-top: 24;
styles [
"boxed-list"
]
Adw.ButtonRow save_row {
title: _("_Create role");
use-underline: true;
activated => $save() swapped;
}
}
}
}
}
}

99
data/ui/editor/tracks.blp Normal file
View file

@ -0,0 +1,99 @@
using Gtk 4.0;
using Adw 1;
template $MusicusTracksEditor: Adw.NavigationPage {
title: _("Tracks");
Adw.ToolbarView {
[top]
Adw.HeaderBar {}
Gtk.ScrolledWindow {
Adw.Clamp {
Gtk.Box {
orientation: vertical;
margin-bottom: 24;
margin-start: 12;
margin-end: 12;
Gtk.Label {
label: _("_Recording");
use-underline: true;
mnemonic-widget: recording_row;
xalign: 0;
margin-top: 24;
styles [
"heading"
]
}
Gtk.ListBox {
selection-mode: none;
margin-top: 12;
styles [
"boxed-list"
]
Adw.ActionRow recording_row {
title: _("Select recording");
activatable: true;
activated => $select_recording() swapped;
[prefix]
Gtk.Box select_recording_box {
Gtk.Image {
icon-name: "document-edit-symbolic";
}
}
}
}
Gtk.Label tracks_label {
label: _("Tracks");
sensitive: false;
xalign: 0;
margin-top: 24;
styles [
"heading"
]
}
Gtk.ListBox track_list {
selection-mode: none;
margin-top: 12;
sensitive: false;
styles [
"boxed-list"
]
Adw.ButtonRow {
title: _("Add _files");
start-icon-name: "list-add-symbolic";
use-underline: true;
activated => $add_files() swapped;
}
}
Gtk.ListBox {
selection-mode: none;
margin-top: 24;
styles [
"boxed-list"
]
Adw.ButtonRow save_row {
title: _("_Import tracks");
use-underline: true;
activated => $save() swapped;
}
}
}
}
}
}
}

View file

@ -0,0 +1,35 @@
using Gtk 4.0;
using Adw 1;
template $MusicusTracksEditorPartsPopover: Gtk.Popover {
styles [
"selector"
]
Adw.ToolbarView {
[top]
Gtk.SearchEntry search_entry {
placeholder-text: _("Search parts…");
margin-start: 8;
margin-end: 8;
margin-top: 8;
margin-bottom: 6;
search-changed => $search_changed() swapped;
activate => $activate() swapped;
stop-search => $stop_search() swapped;
}
Gtk.ScrolledWindow scrolled_window {
height-request: 200;
Gtk.ListBox list_box {
styles [
"selector-list"
]
selection-mode: none;
activate-on-single-click: true;
}
}
}
}

View file

@ -0,0 +1,38 @@
using Gtk 4.0;
using Adw 1;
template $MusicusTracksEditorTrackRow: Adw.ActionRow {
title: _("Select parts");
activatable: true;
activated => $select_parts() swapped;
[prefix]
Gtk.Box select_parts_box {
Gtk.Image {
icon-name: "document-edit-symbolic";
}
}
Gtk.Button reset_button {
icon-name: "edit-clear-symbolic";
tooltip-text: _("Clear selected work parts");
visible: false;
valign: center;
clicked => $reset() swapped;
styles [
"flat"
]
}
Gtk.Button {
icon-name: "user-trash-symbolic";
tooltip-text: _("Remove this track");
valign: center;
clicked => $remove() swapped;
styles [
"flat"
]
}
}

View file

@ -0,0 +1,24 @@
using Gtk 4.0;
using Adw 1;
template $MusicusTranslationEditor: Adw.Bin {
Gtk.ListBox list_box {
selection-mode: none;
styles [
"boxed-list"
]
Adw.EntryRow entry_row {
title: _("_Name");
use-underline: true;
}
Adw.ButtonRow {
title: _("Add _translation");
start-icon-name: "list-add-symbolic";
use-underline: true;
activated => $add_translation() swapped;
}
}
}

View file

@ -0,0 +1,72 @@
using Gtk 4.0;
using Adw 1;
template $MusicusTranslationEntry: Adw.EntryRow {
title: _("Translated name");
Gtk.Button {
icon-name: "user-trash-symbolic";
valign: center;
clicked => $remove() swapped;
styles [
"flat"
]
}
Gtk.Button {
valign: center;
clicked => $open_lang_popover() swapped;
styles [
"flat"
]
Gtk.Box {
spacing: 6;
Gtk.Label {
label: bind lang_entry.text;
}
Gtk.Image {
icon-name: "pan-down-symbolic";
}
Gtk.Popover lang_popover {
Gtk.Box {
orientation: vertical;
spacing: 6;
margin-start: 6;
margin-end: 6;
margin-top: 6;
margin-bottom: 6;
Gtk.Label {
label: _("Language code");
halign: start;
styles [
"heading"
]
}
Gtk.Label {
width-request: 200;
label: _("Enter an <a href=\"https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes\">ISO 639</a> two-letter language code identifying the language this translation uses.");
use-markup: true;
wrap: true;
max-width-chars: 40;
halign: start;
styles [
"dim-label"
]
}
Gtk.Entry lang_entry {}
}
}
}
}
}

130
data/ui/editor/work.blp Normal file
View file

@ -0,0 +1,130 @@
using Gtk 4.0;
using Adw 1;
template $MusicusWorkEditor: Adw.NavigationPage {
title: _("Work");
Adw.ToolbarView {
[top]
Adw.HeaderBar header_bar {}
Gtk.ScrolledWindow {
Adw.Clamp {
Gtk.Box {
orientation: vertical;
margin-bottom: 24;
margin-start: 12;
margin-end: 12;
Gtk.Label {
label: _("Name");
xalign: 0;
margin-top: 24;
styles [
"heading",
]
}
$MusicusTranslationEditor name_editor {
margin-top: 12;
}
Gtk.Label {
label: _("Composers");
xalign: 0;
margin-top: 24;
styles [
"heading",
]
}
Gtk.ListBox composer_list {
selection-mode: none;
margin-top: 12;
styles [
"boxed-list",
]
Adw.ButtonRow {
title: _("Add _composer");
start-icon-name: "list-add-symbolic";
use-underline: true;
activated => $add_person() swapped;
}
}
Gtk.Label {
label: _("Structure");
xalign: 0;
margin-top: 24;
styles [
"heading",
]
}
Gtk.ListBox part_list {
selection-mode: none;
margin-top: 12;
styles [
"boxed-list",
]
Adw.ButtonRow {
title: _("Add _part");
start-icon-name: "list-add-symbolic";
use-underline: true;
activated => $add_part() swapped;
}
}
Gtk.Label {
label: _("Instruments");
xalign: 0;
margin-top: 24;
styles [
"heading",
]
}
Gtk.ListBox instrument_list {
selection-mode: none;
margin-top: 12;
margin-bottom: 24;
styles [
"boxed-list",
]
Adw.ButtonRow {
title: _("Add _instrument");
start-icon-name: "list-add-symbolic";
use-underline: true;
activated => $add_instrument() swapped;
}
}
Gtk.ListBox {
selection-mode: none;
margin-top: 24;
styles [
"boxed-list",
]
Adw.ButtonRow save_row {
title: _("_Create work");
use-underline: true;
activated => $save() swapped;
}
}
}
}
}
}
}

View file

@ -0,0 +1,33 @@
using Gtk 4.0;
using Adw 1;
template $MusicusWorkEditorComposerRow: Adw.ActionRow {
Gtk.Button {
icon-name: "user-trash-symbolic";
valign: center;
clicked => $remove() swapped;
styles [
"flat"
]
}
Gtk.Button {
valign: center;
clicked => $open_role_popover() swapped;
styles [
"flat"
]
Gtk.Box role_box {
spacing: 6;
Gtk.Label role_label {}
Gtk.Image {
icon-name: "pan-down-symbolic";
}
}
}
}

View file

@ -0,0 +1,21 @@
using Gtk 4.0;
using Adw 1;
template $MusicusWorkEditorPartRow: Adw.ActionRow {
activatable: true;
activated => $edit() swapped;
Gtk.Image {
icon-name: "document-edit-symbolic";
}
Gtk.Button {
icon-name: "user-trash-symbolic";
valign: center;
clicked => $remove() swapped;
styles [
"flat"
]
}
}