mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 11:47:25 +01:00
editor: First changes for work editor
This commit is contained in:
parent
15ba043050
commit
55b344605b
19 changed files with 1291 additions and 19 deletions
35
data/ui/instrument_selector_popover.blp
Normal file
35
data/ui/instrument_selector_popover.blp
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $MusicusInstrumentSelectorPopover: Gtk.Popover {
|
||||
styles [
|
||||
"selector"
|
||||
]
|
||||
|
||||
Adw.ToolbarView {
|
||||
[top]
|
||||
Gtk.SearchEntry search_entry {
|
||||
placeholder-text: _("Search instruments…");
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
35
data/ui/person_selector_popover.blp
Normal file
35
data/ui/person_selector_popover.blp
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $MusicusPersonSelectorPopover: Gtk.Popover {
|
||||
styles [
|
||||
"selector"
|
||||
]
|
||||
|
||||
Adw.ToolbarView {
|
||||
[top]
|
||||
Gtk.SearchEntry search_entry {
|
||||
placeholder-text: _("Search persons…");
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
35
data/ui/role_selector_popover.blp
Normal file
35
data/ui/role_selector_popover.blp
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $MusicusRoleSelectorPopover: Gtk.Popover {
|
||||
styles [
|
||||
"selector"
|
||||
]
|
||||
|
||||
Adw.ToolbarView {
|
||||
[top]
|
||||
Gtk.SearchEntry search_entry {
|
||||
placeholder-text: _("Search roles…");
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,20 +1,27 @@
|
|||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $MusicusTranslationEntry : Adw.EntryRow {
|
||||
template $MusicusTranslationEntry: Adw.EntryRow {
|
||||
title: _("Translated name");
|
||||
|
||||
Gtk.Button {
|
||||
icon-name: "edit-delete-symbolic";
|
||||
icon-name: "user-trash-symbolic";
|
||||
valign: center;
|
||||
clicked => $remove() swapped;
|
||||
styles ["flat"]
|
||||
|
||||
styles [
|
||||
"flat"
|
||||
]
|
||||
}
|
||||
|
||||
Gtk.Button {
|
||||
valign: center;
|
||||
clicked => $open_lang_popover() swapped;
|
||||
|
||||
styles [
|
||||
"flat"
|
||||
]
|
||||
|
||||
Gtk.Box {
|
||||
spacing: 6;
|
||||
|
||||
|
|
@ -38,7 +45,10 @@ template $MusicusTranslationEntry : Adw.EntryRow {
|
|||
Gtk.Label {
|
||||
label: _("Language code");
|
||||
halign: start;
|
||||
styles ["heading"]
|
||||
|
||||
styles [
|
||||
"heading"
|
||||
]
|
||||
}
|
||||
|
||||
Gtk.Label {
|
||||
|
|
@ -48,7 +58,10 @@ template $MusicusTranslationEntry : Adw.EntryRow {
|
|||
wrap: true;
|
||||
max-width-chars: 40;
|
||||
halign: start;
|
||||
styles ["dim-label"]
|
||||
|
||||
styles [
|
||||
"dim-label"
|
||||
]
|
||||
}
|
||||
|
||||
Gtk.Entry lang_entry {}
|
||||
|
|
@ -56,4 +69,4 @@ template $MusicusTranslationEntry : Adw.EntryRow {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
119
data/ui/work_editor.blp
Normal file
119
data/ui/work_editor.blp
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
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;
|
||||
|
||||
$MusicusTranslationSection name_section {}
|
||||
|
||||
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.ActionRow {
|
||||
title: _("Add composer");
|
||||
activatable: true;
|
||||
activated => $add_person() swapped;
|
||||
|
||||
[prefix]
|
||||
Gtk.Box select_person_box {
|
||||
Gtk.Image {
|
||||
icon-name: "list-add-symbolic";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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.ActionRow {
|
||||
title: _("Add part");
|
||||
activatable: true;
|
||||
activated => $add_part() swapped;
|
||||
|
||||
[prefix]
|
||||
Gtk.Image {
|
||||
icon-name: "list-add-symbolic";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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.ActionRow {
|
||||
title: _("Add instrument");
|
||||
activatable: true;
|
||||
activated => $add_instrument() swapped;
|
||||
|
||||
[prefix]
|
||||
Gtk.Box select_instrument_box {
|
||||
Gtk.Image {
|
||||
icon-name: "list-add-symbolic";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
33
data/ui/work_editor_composer_row.blp
Normal file
33
data/ui/work_editor_composer_row.blp
Normal 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";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue