diff options
-rw-r--r-- | lib/astal/gtk3/src/widget/centerbox.vala | 23 |
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); + } + } } |