musicus/data/ui/editor/program.blp

278 lines
7 KiB
Text
Raw Normal View History

2025-03-22 18:55:29 +01:00
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";
2025-03-23 08:44:46 +01:00
action-target: "'default'";
2025-03-22 18:55:29 +01:00
styles [
"program-design-button",
2025-03-23 08:44:46 +01:00
"default",
2025-03-22 18:55:29 +01:00
"circular",
]
}
Gtk.ToggleButton {
action-name: "program.set-design";
2025-03-23 08:44:46 +01:00
action-target: "'blue'";
2025-03-22 18:55:29 +01:00
styles [
"program-design-button",
2025-03-23 08:44:46 +01:00
"blue",
2025-03-22 18:55:29 +01:00
"circular",
]
}
Gtk.ToggleButton {
action-name: "program.set-design";
2025-03-23 08:44:46 +01:00
action-target: "'teal'";
2025-03-22 18:55:29 +01:00
styles [
"program-design-button",
2025-03-23 08:44:46 +01:00
"teal",
2025-03-22 18:55:29 +01:00
"circular",
]
}
Gtk.ToggleButton {
action-name: "program.set-design";
2025-03-23 08:44:46 +01:00
action-target: "'green'";
2025-03-22 18:55:29 +01:00
styles [
"program-design-button",
2025-03-23 08:44:46 +01:00
"green",
2025-03-22 18:55:29 +01:00
"circular",
]
}
Gtk.ToggleButton {
action-name: "program.set-design";
2025-03-23 08:44:46 +01:00
action-target: "'yellow'";
2025-03-22 18:55:29 +01:00
styles [
"program-design-button",
2025-03-23 08:44:46 +01:00
"yellow",
2025-03-22 18:55:29 +01:00
"circular",
]
}
Gtk.ToggleButton {
action-name: "program.set-design";
2025-03-23 08:44:46 +01:00
action-target: "'orange'";
2025-03-22 18:55:29 +01:00
styles [
"program-design-button",
2025-03-23 08:44:46 +01:00
"orange",
"circular",
]
}
Gtk.ToggleButton {
action-name: "program.set-design";
action-target: "'red'";
styles [
"program-design-button",
"red",
"circular",
]
}
Gtk.ToggleButton {
action-name: "program.set-design";
action-target: "'pink'";
styles [
"program-design-button",
"pink",
"circular",
]
}
Gtk.ToggleButton {
action-name: "program.set-design";
action-target: "'purple'";
styles [
"program-design-button",
"purple",
"circular",
]
}
Gtk.ToggleButton {
action-name: "program.set-design";
action-target: "'slate'";
styles [
"program-design-button",
"slate",
2025-03-22 18:55:29 +01:00
"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;
styles [
"suggested-action",
]
2025-03-22 18:55:29 +01:00
}
}
}
}
}
}
}