Skip to content

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

feat(domain): add `Container` getter for getting the sibling at the next and previous index to a container

Lars Berger8e954b01b4b9
diff --git a/LarsWM.Domain/Containers/Container.cs b/LarsWM.Domain/Containers/Container.cs
index 62e55e92..4d575805 100644
--- a/LarsWM.Domain/Containers/Container.cs
+++ b/LarsWM.Domain/Containers/Container.cs
@@ -46,6 +46,16 @@ namespace LarsWM.Domain.Containers
}
}
+ /// <summary>
+ /// The sibling at the next index to this container.
+ /// </summary>
+ public Container NextSibling => SelfAndSiblings.ElementAtOrDefault(Index + 1);
+
+ /// <summary>
+ /// The sibling at the previous index to this container.
+ /// </summary>
+ public Container PreviousSibling => SelfAndSiblings.ElementAtOrDefault(Index - 1);
+
// TODO: Rename to SelfAndDescendants and change to getter.
public IEnumerable<Container> Flatten()
{