mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 11:47:25 +01:00
Implement program editor
This commit is contained in:
parent
fa94d61e1e
commit
8950b04ed2
8 changed files with 590 additions and 81 deletions
229
data/ui/editor/program.blp
Normal file
229
data/ui/editor/program.blp
Normal file
|
|
@ -0,0 +1,229 @@
|
|||
using Gtk 4.0;
|
||||
using Adw 1;
|
||||
|
||||
template $MusicusProgramEditor: Adw.NavigationPage {
|
||||
title: _("Program");
|
||||
|
||||
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: _("Appearance");
|
||||
xalign: 0;
|
||||
margin-top: 24;
|
||||
|
||||
styles [
|
||||
"heading",
|
||||
]
|
||||
}
|
||||
|
||||
Gtk.ListBox {
|
||||
selection-mode: none;
|
||||
margin-top: 12;
|
||||
|
||||
styles [
|
||||
"boxed-list",
|
||||
]
|
||||
|
||||
Adw.EntryRow title_row {
|
||||
title: _("Title");
|
||||
}
|
||||
|
||||
Adw.EntryRow description_row {
|
||||
title: _("Description");
|
||||
}
|
||||
|
||||
Adw.PreferencesRow design_row {
|
||||
title: _("Design");
|
||||
activatable: false;
|
||||
focusable: false;
|
||||
|
||||
Gtk.Box {
|
||||
orientation: vertical;
|
||||
spacing: 8;
|
||||
margin-start: 12;
|
||||
margin-end: 12;
|
||||
margin-top: 6;
|
||||
margin-bottom: 6;
|
||||
|
||||
Gtk.Label {
|
||||
label: _("Design");
|
||||
xalign: 0.0;
|
||||
|
||||
styles [
|
||||
"subtitle",
|
||||
]
|
||||
}
|
||||
|
||||
Gtk.Box {
|
||||
spacing: 6;
|
||||
|
||||
Gtk.ToggleButton {
|
||||
action-name: "program.set-design";
|
||||
action-target: "'program-1'";
|
||||
|
||||
styles [
|
||||
"program-design-button",
|
||||
"program-1",
|
||||
"circular",
|
||||
]
|
||||
}
|
||||
|
||||
Gtk.ToggleButton {
|
||||
action-name: "program.set-design";
|
||||
action-target: "'program-2'";
|
||||
|
||||
styles [
|
||||
"program-design-button",
|
||||
"program-2",
|
||||
"circular",
|
||||
]
|
||||
}
|
||||
|
||||
Gtk.ToggleButton {
|
||||
action-name: "program.set-design";
|
||||
action-target: "'program-3'";
|
||||
|
||||
styles [
|
||||
"program-design-button",
|
||||
"program-3",
|
||||
"circular",
|
||||
]
|
||||
}
|
||||
|
||||
Gtk.ToggleButton {
|
||||
action-name: "program.set-design";
|
||||
action-target: "'program-4'";
|
||||
|
||||
styles [
|
||||
"program-design-button",
|
||||
"program-4",
|
||||
"circular",
|
||||
]
|
||||
}
|
||||
|
||||
Gtk.ToggleButton {
|
||||
action-name: "program.set-design";
|
||||
action-target: "'program-5'";
|
||||
|
||||
styles [
|
||||
"program-design-button",
|
||||
"program-5",
|
||||
"circular",
|
||||
]
|
||||
}
|
||||
|
||||
Gtk.ToggleButton {
|
||||
action-name: "program.set-design";
|
||||
action-target: "'program-6'";
|
||||
|
||||
styles [
|
||||
"program-design-button",
|
||||
"program-6",
|
||||
"circular",
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Gtk.Label {
|
||||
label: _("Settings");
|
||||
xalign: 0;
|
||||
margin-top: 24;
|
||||
|
||||
styles [
|
||||
"heading",
|
||||
]
|
||||
}
|
||||
|
||||
Gtk.ListBox {
|
||||
selection-mode: none;
|
||||
margin-top: 12;
|
||||
|
||||
styles [
|
||||
"boxed-list",
|
||||
]
|
||||
|
||||
$MusicusSliderRow {
|
||||
title: _("Prefer recordings that haven't been played for a long time");
|
||||
suffix: _("%");
|
||||
|
||||
adjustment: Gtk.Adjustment prefer_least_recently_played_adjustment {
|
||||
lower: 0;
|
||||
upper: 100;
|
||||
step-increment: 1;
|
||||
page-increment: 10;
|
||||
};
|
||||
}
|
||||
|
||||
$MusicusSliderRow {
|
||||
title: _("Prefer recordings that were recently added");
|
||||
suffix: _("%");
|
||||
|
||||
adjustment: Gtk.Adjustment prefer_recently_added_adjustment {
|
||||
lower: 0;
|
||||
upper: 100;
|
||||
step-increment: 1;
|
||||
page-increment: 10;
|
||||
};
|
||||
}
|
||||
|
||||
$MusicusSliderRow {
|
||||
title: _("Avoid repeating composers");
|
||||
suffix: _(" min");
|
||||
|
||||
adjustment: Gtk.Adjustment avoid_repeated_composers_adjustment {
|
||||
lower: 0;
|
||||
upper: 120;
|
||||
step-increment: 10;
|
||||
page-increment: 30;
|
||||
};
|
||||
}
|
||||
|
||||
$MusicusSliderRow {
|
||||
title: _("Avoid repeating instruments");
|
||||
suffix: _(" min");
|
||||
|
||||
adjustment: Gtk.Adjustment avoid_repeated_instruments_adjustment {
|
||||
lower: 0;
|
||||
upper: 120;
|
||||
step-increment: 10;
|
||||
page-increment: 30;
|
||||
};
|
||||
}
|
||||
|
||||
Adw.SwitchRow play_full_recordings_row {
|
||||
title: _("Play full recordings");
|
||||
}
|
||||
}
|
||||
|
||||
Gtk.ListBox {
|
||||
selection-mode: none;
|
||||
margin-top: 24;
|
||||
|
||||
styles [
|
||||
"boxed-list",
|
||||
]
|
||||
|
||||
Adw.ButtonRow save_row {
|
||||
title: _("_Save program");
|
||||
use-underline: true;
|
||||
activated => $save() swapped;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +1,46 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
template $MusicusProgramTile : Gtk.FlowBoxChild {
|
||||
styles ["program", "card", "activatable"]
|
||||
|
||||
template $MusicusProgramTile: Gtk.FlowBoxChild {
|
||||
styles [
|
||||
"program-tile",
|
||||
"card",
|
||||
"activatable",
|
||||
]
|
||||
|
||||
Gtk.Box {
|
||||
orientation: vertical;
|
||||
|
||||
|
||||
Gtk.Button edit_button {
|
||||
styles ["flat", "circular"]
|
||||
halign: end;
|
||||
icon-name: "document-edit-symbolic";
|
||||
clicked => $edit_button_clicked() swapped;
|
||||
|
||||
styles [
|
||||
"flat",
|
||||
"circular",
|
||||
]
|
||||
}
|
||||
|
||||
Gtk.Label title_label {
|
||||
styles ["title"]
|
||||
halign: start;
|
||||
margin-top: 24;
|
||||
wrap: true;
|
||||
max-width-chars: 0;
|
||||
|
||||
styles [
|
||||
"title",
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
Gtk.Label description_label {
|
||||
styles ["description"]
|
||||
margin-top: 6;
|
||||
halign: start;
|
||||
wrap: true;
|
||||
max-width-chars: 0;
|
||||
|
||||
styles [
|
||||
"description",
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue