From 2f71cd4c08bb4514efe43533e6a5d03535204c29 Mon Sep 17 00:00:00 2001 From: Aylur Date: Tue, 15 Oct 2024 01:26:32 +0200 Subject: refactor lua and gjs lib --- core/src/widget/box.vala | 62 ------------------------------------------------ 1 file changed, 62 deletions(-) delete mode 100644 core/src/widget/box.vala (limited to 'core/src/widget/box.vala') diff --git a/core/src/widget/box.vala b/core/src/widget/box.vala deleted file mode 100644 index 943c821..0000000 --- a/core/src/widget/box.vala +++ /dev/null @@ -1,62 +0,0 @@ -namespace Astal { -public class Box : Gtk.Box { - [CCode (notify = false)] - public bool vertical { - get { return orientation == Gtk.Orientation.VERTICAL; } - set { orientation = value ? Gtk.Orientation.VERTICAL : Gtk.Orientation.HORIZONTAL; } - } - - public List children { - set { _set_children(value); } - owned get { return get_children(); } - } - - public new Gtk.Widget child { - owned get { return _get_child(); } - set { _set_child(value); } - } - - construct { - notify["orientation"].connect(() => { - notify_property("vertical"); - }); - } - - private void _set_child(Gtk.Widget child) { - var list = new List(); - list.append(child); - _set_children(list); - } - - private Gtk.Widget? _get_child() { - foreach(var child in get_children()) - return child; - - return null; - } - - private void _set_children(List arr) { - foreach(var child in get_children()) { - remove(child); - } - - foreach(var child in arr) - add(child); - } - - public Box(bool vertical, List children) { - this.vertical = vertical; - _set_children(children); - } - - public Box.newh(List children) { - this.vertical = false; - _set_children(children); - } - - public Box.newv(List children) { - this.vertical = true; - _set_children(children); - } -} -} -- cgit v1.2.3