mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 03:47:23 +01:00
Implement program editor
This commit is contained in:
parent
fa94d61e1e
commit
8950b04ed2
8 changed files with 590 additions and 81 deletions
|
|
@ -56,55 +56,65 @@
|
|||
font-style: italic;
|
||||
}
|
||||
|
||||
.program {
|
||||
.program-tile {
|
||||
padding: 12px;
|
||||
min-width: 200px;
|
||||
transition: transform 100ms;
|
||||
}
|
||||
|
||||
.program .title {
|
||||
.program-tile:hover {
|
||||
transform: scale(1.01);
|
||||
}
|
||||
|
||||
.program-tile:active {
|
||||
transform: scale(0.99);
|
||||
}
|
||||
|
||||
.program-tile .title {
|
||||
margin-top: 6px;
|
||||
font-size: larger;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.program.highlight {
|
||||
color: white;
|
||||
transition: transform 100ms;
|
||||
.program-design-button {
|
||||
min-width: 24px;
|
||||
min-height: 24px;
|
||||
}
|
||||
|
||||
.program.highlight.program1 {
|
||||
.program-design-button:checked {
|
||||
box-shadow: 0 0 0 3px var(--accent-bg-color);
|
||||
}
|
||||
|
||||
.program-1 {
|
||||
color: white;
|
||||
background: linear-gradient(-225deg, #ac32e4 0%, #7918f2 48%, #4801ff 100%);
|
||||
}
|
||||
|
||||
.program.highlight.program2 {
|
||||
.program-2 {
|
||||
color: white;
|
||||
background: linear-gradient(145deg, #f12711, #f5af19);
|
||||
}
|
||||
|
||||
.program.highlight.program3 {
|
||||
.program-3 {
|
||||
color: white;
|
||||
background: linear-gradient(-80deg, #ad5389, #3c1053);
|
||||
}
|
||||
|
||||
.program.highlight.program4 {
|
||||
.program-4 {
|
||||
color: white;
|
||||
background: linear-gradient(140deg, #136797, #0b486b);
|
||||
}
|
||||
|
||||
.program.highlight.program5 {
|
||||
.program-5 {
|
||||
color: white;
|
||||
background: linear-gradient(100deg, #6a9113, #141517);
|
||||
}
|
||||
|
||||
.program.highlight.program6 {
|
||||
.program-6 {
|
||||
color: white;
|
||||
background: linear-gradient(120deg, #870000, #190a05);
|
||||
}
|
||||
|
||||
|
||||
.program.highlight:hover {
|
||||
transform: scale(1.01);
|
||||
}
|
||||
|
||||
.program.highlight:active {
|
||||
transform: scale(0.99);
|
||||
}
|
||||
|
||||
.selector>contents {
|
||||
padding: 0;
|
||||
}
|
||||
|
|
|
|||
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