diff options
author | Aylur <[email protected]> | 2025-03-08 02:16:18 +0100 |
---|---|---|
committer | noname <[email protected]> | 2025-04-25 01:19:20 +1000 |
commit | 38910b9ba8655ffb6333c97c2acc0132e9f585b6 (patch) | |
tree | f0ce35e9eac3db09dd0f67413eb441956dca6aad | |
parent | fe0aedc370db3ea68a66479ea7cfb214f00786dd (diff) |
astal3: centerbox Gtk.Buildable impl
-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); + } + } } |