Skip to content

GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.

feat(domain): add `Container` getter for getting the index of a container amongst its siblings

Lars Berger94bcd6715394
diff --git a/LarsWM.Domain/Containers/Container.cs b/LarsWM.Domain/Containers/Container.cs
index bcafc7e9..62e55e92 100644
--- a/LarsWM.Domain/Containers/Container.cs
+++ b/LarsWM.Domain/Containers/Container.cs
@@ -25,6 +25,11 @@ namespace LarsWM.Domain.Containers
}
}
+ /// <summary>
+ /// Index of this container amongst its siblings.
+ /// </summary>
+ public int Index => Parent.Children.IndexOf(this);
+
/// <summary>
/// Get the element at the bottom of the focus stack.
/// </summary>