summaryrefslogtreecommitdiff
path: root/core/src/widget/box.vala
diff options
context:
space:
mode:
authorAylur <[email protected]>2024-10-15 15:30:04 +0200
committerGitHub <[email protected]>2024-10-15 15:30:04 +0200
commitcbe650afb31c24faea6da45b4aeeffc6e964969d (patch)
treed5c3788835ca7e50d68cd023026e7738f39f6f71 /core/src/widget/box.vala
parentbdb23e20f171da7c769cba9e393d7e406e563a78 (diff)
parentbafd48d3df9b43a1d49ec015eff30619d595468b (diff)
Merge pull request #46 from Aylur/small-refactor
Small refactor
Diffstat (limited to 'core/src/widget/box.vala')
-rw-r--r--core/src/widget/box.vala62
1 files changed, 0 insertions, 62 deletions
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<weak Gtk.Widget> 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<weak Gtk.Widget>();
- 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<weak Gtk.Widget> arr) {
- foreach(var child in get_children()) {
- remove(child);
- }
-
- foreach(var child in arr)
- add(child);
- }
-
- public Box(bool vertical, List<weak Gtk.Widget> children) {
- this.vertical = vertical;
- _set_children(children);
- }
-
- public Box.newh(List<weak Gtk.Widget> children) {
- this.vertical = false;
- _set_children(children);
- }
-
- public Box.newv(List<weak Gtk.Widget> children) {
- this.vertical = true;
- _set_children(children);
- }
-}
-}