gui: Port to Blueprint

This was mostly done with `blueprint-compiler port`.

Since Blueprint doesn't know about custom templates, I had to manually change some values from strings to literals.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/567>
This commit is contained in:
Jamie Gravendeel
2025-06-08 14:31:01 +02:00
parent 2aceaa816f
commit a509de8b1e
90 changed files with 3278 additions and 3867 deletions
+92
View File
@@ -0,0 +1,92 @@
using Gtk 4.0;
using Adw 1;
template $GcalDateChooser: Adw.Bin {
Grid {
orientation: vertical;
$GcalMultiChoice month_choice {
halign: fill;
min-value: 0;
max-value: 11;
animate: false;
value: 0;
visible: bind $get_split_choice_visible(template.show-heading, template.split-month-year) as <bool>;
notify::value => $split_multi_choice_changed() swapped;
layout {
column: 0;
row: 0;
}
}
$GcalMultiChoice year_choice {
visible: bind $get_split_choice_visible(template.show-heading, template.split-month-year) as <bool>;
halign: fill;
min-value: 1;
max-value: 9999;
animate: false;
value: 0;
notify::value => $split_multi_choice_changed() swapped;
layout {
column: 1;
row: 0;
}
}
$GcalMultiChoice combined_choice {
visible: bind $get_combined_choice_visible(template.show-heading, template.split-month-year) as <bool>;
halign: fill;
min-value: 12;
max-value: 119999;
popover: popover;
animate: false;
value: 0;
notify::value => $combined_multi_choice_changed() swapped;
layout {
column: 0;
column-span: 2;
row: 0;
}
}
Grid grid {
row-homogeneous: true;
column-homogeneous: true;
layout {
column: 0;
column-span: 2;
row: 1;
}
}
}
}
Popover popover {
Box {
orientation: vertical;
spacing: 12;
$GcalMultiChoice popover_month_choice {
min-value: bind month_choice.min-value bidirectional;
max-value: bind month_choice.max-value bidirectional;
animate: bind month_choice.animate bidirectional;
value: bind month_choice.value bidirectional;
}
$GcalMultiChoice {
min-value: bind year_choice.min-value bidirectional;
max-value: bind year_choice.max-value bidirectional;
animate: bind year_choice.animate bidirectional;
value: bind year_choice.value bidirectional;
}
styles [
"activatable",
"month",
]
}
}