From 0df3641128ddd482cd4da07e5e1eb2e941b07c7d Mon Sep 17 00:00:00 2001 From: Shawn Zhong Date: Sat, 28 Sep 2024 03:31:45 -0500 Subject: [PATCH 1/3] =?UTF-8?q?=E2=9C=A8=20Add=20horizontal/vertical=20cen?= =?UTF-8?q?ter=20half?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Loop/Localizable.xcstrings | 22 +++++++++++++++++++ .../WindowDirection+LocalizedString.swift | 4 ++++ Loop/Window Management/WindowDirection.swift | 5 ++++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/Loop/Localizable.xcstrings b/Loop/Localizable.xcstrings index f9a6ba8d..ccbbbed2 100644 --- a/Loop/Localizable.xcstrings +++ b/Loop/Localizable.xcstrings @@ -20067,6 +20067,17 @@ } } }, + "Window Direction/Name: Horizontal Center Half" : { + "extractionState" : "extracted_with_value", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "Horizontal Center Half" + } + } + } + }, "Window Direction/Name: Horizontal Center Third" : { "extractionState" : "manual", "localizations" : { @@ -22197,6 +22208,17 @@ } } }, + "Window Direction/Name: Vertical Center Half" : { + "extractionState" : "extracted_with_value", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "Vertical Center Half" + } + } + } + }, "Window Direction/Name: Vertical Center Third" : { "extractionState" : "manual", "localizations" : { diff --git a/Loop/Window Management/WindowDirection+LocalizedString.swift b/Loop/Window Management/WindowDirection+LocalizedString.swift index e3b11fbd..c648e499 100644 --- a/Loop/Window Management/WindowDirection+LocalizedString.swift +++ b/Loop/Window Management/WindowDirection+LocalizedString.swift @@ -49,6 +49,10 @@ extension WindowDirection { .init(localized: .init("Window Direction/Name: Bottom Half", defaultValue: "Bottom Half")) case .leftHalf: .init(localized: .init("Window Direction/Name: Left Half", defaultValue: "Left Half")) + case .horizontalCenterHalf: + .init(localized: .init("Window Direction/Name: Horizontal Center Half", defaultValue: "Horizontal Center Half")) + case .verticalCenterHalf: + .init(localized: .init("Window Direction/Name: Vertical Center Half", defaultValue: "Vertical Center Half")) case .topLeftQuarter: .init(localized: .init("Window Direction/Name: Top Left Quarter", defaultValue: "Top Left Quarter")) case .topRightQuarter: diff --git a/Loop/Window Management/WindowDirection.swift b/Loop/Window Management/WindowDirection.swift index 03f5c74b..23f15a57 100644 --- a/Loop/Window Management/WindowDirection.swift +++ b/Loop/Window Management/WindowDirection.swift @@ -19,6 +19,7 @@ enum WindowDirection: String, CaseIterable, Identifiable, Codable { // Halves case topHalf = "TopHalf", rightHalf = "RightHalf", bottomHalf = "BottomHalf", leftHalf = "LeftHalf" + case horizontalCenterHalf = "HorizontalCenterHalf", verticalCenterHalf = "VerticalCenterHalf" // Quarters case topLeftQuarter = "TopLeftQuarter", topRightQuarter = "TopRightQuarter" @@ -54,7 +55,7 @@ enum WindowDirection: String, CaseIterable, Identifiable, Codable { // These are used in the menubar resize submenu & keybind configuratio static var general: [WindowDirection] { [.fullscreen, .maximize, .almostMaximize, .center, .macOSCenter, .minimize, .hide] } - static var halves: [WindowDirection] { [.topHalf, .bottomHalf, .leftHalf, .rightHalf] } + static var halves: [WindowDirection] { [.topHalf, .bottomHalf, .leftHalf, .rightHalf, .horizontalCenterHalf, .verticalCenterHalf] } static var quarters: [WindowDirection] { [.topLeftQuarter, .topRightQuarter, .bottomLeftQuarter, .bottomRightQuarter] } static var horizontalThirds: [WindowDirection] { [.rightThird, .rightTwoThirds, .horizontalCenterThird, .leftTwoThirds, .leftThird] } static var verticalThirds: [WindowDirection] { [.topThird, .topTwoThirds, .verticalCenterThird, .bottomTwoThirds, .bottomThird] } @@ -91,6 +92,8 @@ enum WindowDirection: String, CaseIterable, Identifiable, Codable { case .rightHalf: .init(x: 1.0 / 2.0, y: 0, width: 1.0 / 2.0, height: 1.0) case .bottomHalf: .init(x: 0, y: 1.0 / 2.0, width: 1.0, height: 1.0 / 2.0) case .leftHalf: .init(x: 0, y: 0, width: 1.0 / 2.0, height: 1.0) + case .horizontalCenterHalf: .init(x: 1.0 / 4.0, y: 0, width: 1.0 / 2.0, height: 1.0) + case .verticalCenterHalf: .init(x: 0, y: 1.0 / 4.0, width: 1.0, height: 1.0 / 2.0) // Quarters case .topLeftQuarter: .init(x: 0, y: 0, width: 1.0 / 2.0, height: 1.0 / 2.0) case .topRightQuarter: .init(x: 1.0 / 2.0, y: 0, width: 1.0 / 2.0, height: 1.0 / 2.0) From 4fc9ac536e301b3ade7a0e0241df3443dea247c1 Mon Sep 17 00:00:00 2001 From: Shawn Zhong Date: Sun, 29 Sep 2024 04:01:39 -0500 Subject: [PATCH 2/3] =?UTF-8?q?=E2=9C=A8=20Add=20mapping=20for=20Rectangle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Loop/Utilities/RectangleTranslationLayer.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Loop/Utilities/RectangleTranslationLayer.swift b/Loop/Utilities/RectangleTranslationLayer.swift index dad0d181..a29a9273 100644 --- a/Loop/Utilities/RectangleTranslationLayer.swift +++ b/Loop/Utilities/RectangleTranslationLayer.swift @@ -27,6 +27,7 @@ enum RectangleTranslationLayer { "bottomHalf": .bottomHalf, "bottomRight": .bottomRightQuarter, "center": .center, + "centerHalf": .horizontalCenterHalf, "larger": .larger, "leftHalf": .leftHalf, "maximize": .maximize, From 4631d35881b4ec05b375d878178158ec8d23ab87 Mon Sep 17 00:00:00 2001 From: Shawn Zhong Date: Tue, 1 Oct 2024 03:31:58 -0500 Subject: [PATCH 3/3] =?UTF-8?q?=E2=9C=A8=20Reorder=20halves?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Loop/Window Management/WindowDirection.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Loop/Window Management/WindowDirection.swift b/Loop/Window Management/WindowDirection.swift index 23f15a57..b9af85c7 100644 --- a/Loop/Window Management/WindowDirection.swift +++ b/Loop/Window Management/WindowDirection.swift @@ -55,7 +55,7 @@ enum WindowDirection: String, CaseIterable, Identifiable, Codable { // These are used in the menubar resize submenu & keybind configuratio static var general: [WindowDirection] { [.fullscreen, .maximize, .almostMaximize, .center, .macOSCenter, .minimize, .hide] } - static var halves: [WindowDirection] { [.topHalf, .bottomHalf, .leftHalf, .rightHalf, .horizontalCenterHalf, .verticalCenterHalf] } + static var halves: [WindowDirection] { [.topHalf, .verticalCenterHalf, .bottomHalf, .leftHalf, .horizontalCenterHalf, .rightHalf] } static var quarters: [WindowDirection] { [.topLeftQuarter, .topRightQuarter, .bottomLeftQuarter, .bottomRightQuarter] } static var horizontalThirds: [WindowDirection] { [.rightThird, .rightTwoThirds, .horizontalCenterThird, .leftTwoThirds, .leftThird] } static var verticalThirds: [WindowDirection] { [.topThird, .topTwoThirds, .verticalCenterThird, .bottomTwoThirds, .bottomThird] }