summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAylur <[email protected]>2025-03-08 02:16:18 +0100
committernoname <[email protected]>2025-04-25 01:19:20 +1000
commit38910b9ba8655ffb6333c97c2acc0132e9f585b6 (patch)
treef0ce35e9eac3db09dd0f67413eb441956dca6aad /lib
parentfe0aedc370db3ea68a66479ea7cfb214f00786dd (diff)
astal3: centerbox Gtk.Buildable impl
Diffstat (limited to 'lib')
-rw-r--r--lib/astal/gtk3/src/widget/centerbox.vala23
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/astal/gtk3/src/widget/centerbox.vala b/lib/astal/gtk3/src/widget/centerbox.vala
index d74a2c4..0459c17 100644
--- a/lib/astal/gtk3/src/widget/centerbox.vala
+++ b/lib/astal/gtk3/src/widget/centerbox.vala
@@ -1,4 +1,4 @@
-public class Astal.CenterBox : Gtk.Box {
+public class Astal.CenterBox : Gtk.Box, Gtk.Buildable {
/**
* Corresponds to [[email protected] :orientation].
*/
@@ -52,4 +52,25 @@ public class Astal.CenterBox : Gtk.Box {
set_center_widget(value);
}
}
+
+ void add_child(Gtk.Builder builder, Object child, string? type) {
+ if (child is Gtk.Widget) {
+ switch (type) {
+ case "start":
+ start_widget = child as Gtk.Widget;
+ break;
+ case "center":
+ center_widget = child as Gtk.Widget;
+ break;
+ case "end":
+ end_widget = child as Gtk.Widget;
+ break;
+ default:
+ base.add_child(builder, child, type);
+ break;
+ }
+ } else {
+ base.add_child(builder, child, type);
+ }
+ }
}