Skip to content

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

refactor(domain): change `Layout` enum values to be uppercase

Lars Berger96c25e198171
diff --git a/LarsWM.Domain/Common/Enums/Direction.cs b/LarsWM.Domain/Common/Enums/Direction.cs
index a312827f..85e644c3 100644
--- a/LarsWM.Domain/Common/Enums/Direction.cs
+++ b/LarsWM.Domain/Common/Enums/Direction.cs
@@ -38,7 +38,7 @@ namespace LarsWM.Domain.Common.Enums
public static Layout GetCorrespondingLayout(this Direction direction)
{
return (direction == Direction.LEFT || direction == Direction.RIGHT)
- ? Layout.Horizontal : Layout.Vertical;
+ ? Layout.HORIZONTAL : Layout.VERTICAL;
}
}
}
diff --git a/LarsWM.Domain/Common/Enums/Layout.cs b/LarsWM.Domain/Common/Enums/Layout.cs
index ae1ea48c..e7e754a1 100644
--- a/LarsWM.Domain/Common/Enums/Layout.cs
+++ b/LarsWM.Domain/Common/Enums/Layout.cs
@@ -2,7 +2,7 @@
{
public enum Layout
{
- Vertical,
- Horizontal,
+ VERTICAL,
+ HORIZONTAL,
}
}
diff --git a/LarsWM.Domain/Common/Services/KeybindingService.cs b/LarsWM.Domain/Common/Services/KeybindingService.cs
index a3e574ba..65a23269 100644
--- a/LarsWM.Domain/Common/Services/KeybindingService.cs
+++ b/LarsWM.Domain/Common/Services/KeybindingService.cs
@@ -110,9 +110,9 @@ namespace LarsWM.Domain.Common.Services
if (pressedKey == Keys.P)
_bus.Invoke(new ResizeFocusedWindowCommand(ResizeDirection.GROW_WIDTH));
if (pressedKey == Keys.V)
- _bus.Invoke(new ChangeContainerLayoutCommand(Layout.Vertical));
+ _bus.Invoke(new ChangeContainerLayoutCommand(Layout.VERTICAL));
if (pressedKey == Keys.B)
- _bus.Invoke(new ChangeContainerLayoutCommand(Layout.Horizontal));
+ _bus.Invoke(new ChangeContainerLayoutCommand(Layout.HORIZONTAL));
}
);
}
diff --git a/LarsWM.Domain/Containers/ContainerService.cs b/LarsWM.Domain/Containers/ContainerService.cs
index ab7d668a..19d0c41e 100644
--- a/LarsWM.Domain/Containers/ContainerService.cs
+++ b/LarsWM.Domain/Containers/ContainerService.cs
@@ -40,7 +40,7 @@ namespace LarsWM.Domain.Containers
{
var parent = container.Parent as SplitContainer;
- if (parent.Layout == Layout.Vertical)
+ if (parent.Layout == Layout.VERTICAL)
return parent.Width;
var innerGap = _userConfigService.UserConfig.InnerGap;
@@ -56,7 +56,7 @@ namespace LarsWM.Domain.Containers
{
var parent = container.Parent as SplitContainer;
- if (parent.Layout == Layout.Horizontal)
+ if (parent.Layout == Layout.HORIZONTAL)
return parent.Height;
var innerGap = _userConfigService.UserConfig.InnerGap;
@@ -72,7 +72,7 @@ namespace LarsWM.Domain.Containers
{
var parent = container.Parent as SplitContainer;
- if (parent.Layout == Layout.Vertical || container.Index == 0)
+ if (parent.Layout == Layout.VERTICAL || container.Index == 0)
return parent.X;
var innerGap = _userConfigService.UserConfig.InnerGap;
@@ -88,7 +88,7 @@ namespace LarsWM.Domain.Containers
{
var parent = container.Parent as SplitContainer;
- if (parent.Layout == Layout.Horizontal || container.Index == 0)
+ if (parent.Layout == Layout.HORIZONTAL || container.Index == 0)
return parent.Y;
var innerGap = _userConfigService.UserConfig.InnerGap;
diff --git a/LarsWM.Domain/Containers/SplitContainer.cs b/LarsWM.Domain/Containers/SplitContainer.cs
index 2f8c182e..a905c7a9 100644
--- a/LarsWM.Domain/Containers/SplitContainer.cs
+++ b/LarsWM.Domain/Containers/SplitContainer.cs
@@ -6,7 +6,7 @@ namespace LarsWM.Domain.Containers
{
public class SplitContainer : Container
{
- public Layout Layout { get; set; } = Layout.Horizontal;
+ public Layout Layout { get; set; } = Layout.HORIZONTAL;
public override int Width => _containerService.CalculateWidthOfResizableContainer(this);
diff --git a/LarsWM.Domain/Windows/CommandHandlers/ResizeFocusedWindowHandler.cs b/LarsWM.Domain/Windows/CommandHandlers/ResizeFocusedWindowHandler.cs
index a363977d..622938ea 100644
--- a/LarsWM.Domain/Windows/CommandHandlers/ResizeFocusedWindowHandler.cs
+++ b/LarsWM.Domain/Windows/CommandHandlers/ResizeFocusedWindowHandler.cs
@@ -37,9 +37,9 @@ namespace LarsWM.Domain.Windows.CommandHandlers
// Whether the parent of the focused window should be resized rather than the focused window itself.
var shouldResizeParent =
- (layout == Layout.Horizontal &&
+ (layout == Layout.HORIZONTAL &&
(resizeDirection == ResizeDirection.SHRINK_HEIGHT || resizeDirection == ResizeDirection.GROW_HEIGHT)) ||
- (layout == Layout.Vertical &&
+ (layout == Layout.VERTICAL &&
(resizeDirection == ResizeDirection.SHRINK_WIDTH || resizeDirection == ResizeDirection.GROW_WIDTH));
var containerToResize = shouldResizeParent ? focusedWindow.Parent : focusedWindow;