Skip to content

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

refactor(domain): rename `Direction` enum -> `ResizeDirection`; rename enum values

Larsb1f80d27289c
diff --git a/LarsWM.Domain/Common/Enums/Direction.cs b/LarsWM.Domain/Common/Enums/Direction.cs
deleted file mode 100644
index aa15cc39..00000000
--- a/LarsWM.Domain/Common/Enums/Direction.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace LarsWM.Domain.Common.Enums
-{
- public enum Direction
- {
- Up,
- Down,
- Left,
- Right,
- }
-}
diff --git a/LarsWM.Domain/Common/Enums/ResizeDirection.cs b/LarsWM.Domain/Common/Enums/ResizeDirection.cs
new file mode 100644
index 00000000..bf05810c
--- /dev/null
+++ b/LarsWM.Domain/Common/Enums/ResizeDirection.cs
@@ -0,0 +1,10 @@
+namespace LarsWM.Domain.Common.Enums
+{
+ public enum ResizeDirection
+ {
+ GROW_HEIGHT,
+ SHRINK_HEIGHT,
+ SHRINK_WIDTH,
+ GROW_WIDTH,
+ }
+}
diff --git a/LarsWM.Domain/Common/Services/KeybindingService.cs b/LarsWM.Domain/Common/Services/KeybindingService.cs
index c904556b..9f4decf8 100644
--- a/LarsWM.Domain/Common/Services/KeybindingService.cs
+++ b/LarsWM.Domain/Common/Services/KeybindingService.cs
@@ -94,9 +94,9 @@ namespace LarsWM.Domain.Common.Services
if (pressedKey == Keys.D9)
_bus.Invoke(new FocusWorkspaceCommand("9"));
if (pressedKey == Keys.U)
- _bus.Invoke(new ResizeFocusedWindowCommand(Direction.Left));
+ _bus.Invoke(new ResizeFocusedWindowCommand(ResizeDirection.SHRINK_WIDTH));
if (pressedKey == Keys.P)
- _bus.Invoke(new ResizeFocusedWindowCommand(Direction.Right));
+ _bus.Invoke(new ResizeFocusedWindowCommand(ResizeDirection.GROW_WIDTH));
if (pressedKey == Keys.V)
_bus.Invoke(new ChangeContainerLayoutCommand(Layout.Vertical));
if (pressedKey == Keys.B)
diff --git a/LarsWM.Domain/Windows/CommandHandlers/ResizeFocusedWindowHandler.cs b/LarsWM.Domain/Windows/CommandHandlers/ResizeFocusedWindowHandler.cs
index 75723f61..5650f9e1 100644
--- a/LarsWM.Domain/Windows/CommandHandlers/ResizeFocusedWindowHandler.cs
+++ b/LarsWM.Domain/Windows/CommandHandlers/ResizeFocusedWindowHandler.cs
@@ -38,7 +38,7 @@ namespace LarsWM.Domain.Windows.CommandHandlers
var resizePercentage = _userConfigService.UserConfig.ResizePercentage;
var layout = parent.Layout;
- if (layout == Layout.Horizontal && command.Direction == Direction.Right)
+ if (layout == Layout.Horizontal && command.ResizeDirection == ResizeDirection.GROW_WIDTH)
{
focusedWindow.SizePercentage += resizePercentage;
@@ -46,7 +46,7 @@ namespace LarsWM.Domain.Windows.CommandHandlers
sibling.SizePercentage -= resizePercentage / siblings.Count();
}
- if (layout == Layout.Horizontal && command.Direction == Direction.Left)
+ if (layout == Layout.Horizontal && command.ResizeDirection == ResizeDirection.SHRINK_WIDTH)
{
focusedWindow.SizePercentage -= resizePercentage;
diff --git a/LarsWM.Domain/Windows/Commands/ResizeFocusedWindowCommand.cs b/LarsWM.Domain/Windows/Commands/ResizeFocusedWindowCommand.cs
index 0723db99..996f89ec 100644
--- a/LarsWM.Domain/Windows/Commands/ResizeFocusedWindowCommand.cs
+++ b/LarsWM.Domain/Windows/Commands/ResizeFocusedWindowCommand.cs
@@ -5,11 +5,11 @@ namespace LarsWM.Domain.Windows.Commands
{
public class ResizeFocusedWindowCommand : Command
{
- public Direction Direction { get; }
+ public ResizeDirection ResizeDirection { get; }
- public ResizeFocusedWindowCommand(Direction direction)
+ public ResizeFocusedWindowCommand(ResizeDirection resizeDirection)
{
- Direction = direction;
+ ResizeDirection = resizeDirection;
}
}
}