-
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔀 Merge pull request #150 from `MrKai77/77-option-to-use-macos-center…
…-instead-of-screen-center` ✨ #77 Option to use macOS center instead of screen center
- Loading branch information
Showing
11 changed files
with
201 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
Loop/Window Management/Custom Window Sizes/CustomWindowActionAnchor.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// CustomWindowActionAnchor.swift | ||
// Loop | ||
// | ||
// Created by Kai Azim on 2024-01-01. | ||
// | ||
|
||
import SwiftUI | ||
|
||
enum CustomWindowActionAnchor: Int, Codable, CaseIterable, Identifiable { | ||
var id: Self { self } | ||
|
||
case topLeft = 0 | ||
case top = 1 | ||
case topRight = 2 | ||
case right = 3 | ||
case bottomRight = 4 | ||
case bottom = 5 | ||
case bottomLeft = 6 | ||
case left = 7 | ||
case center = 8 | ||
case macOSCenter = 9 | ||
|
||
var label: Text { | ||
switch self { | ||
case .topLeft: Text("\(Image(systemName: "arrow.up.left")) Top Left") | ||
case .top: Text("\(Image(systemName: "arrow.up")) Top") | ||
case .topRight: Text("\(Image(systemName: "arrow.up.right")) Top Right") | ||
case .right: Text("\(Image(systemName: "arrow.right")) Right") | ||
case .bottomRight: Text("\(Image(systemName: "arrow.down.right")) Bottom Right") | ||
case .bottom: Text("\(Image(systemName: "arrow.down")) Bottom") | ||
case .bottomLeft: Text("\(Image(systemName: "arrow.down.left")) Bottom Left") | ||
case .left: Text("\(Image(systemName: "arrow.left")) Left") | ||
case .center: Text("\(Image(systemName: "scope")) Center") | ||
case .macOSCenter: Text("\(Image(systemName: "scope")) MacOS Center") | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
Loop/Window Management/Custom Window Sizes/CustomWindowActionMeasureSystem.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// CustomWindowActionMeasureSystem.swift | ||
// Loop | ||
// | ||
// Created by Kai Azim on 2024-01-01. | ||
// | ||
|
||
import SwiftUI | ||
|
||
enum CustomWindowActionMeasureSystem: Int, Codable, CaseIterable, Identifiable { | ||
var id: Self { self } | ||
|
||
case pixels = 0 | ||
case percentage = 1 | ||
|
||
var label: Text { | ||
switch self { | ||
case .pixels: | ||
Text("\(Image(systemName: "rectangle.checkered")) Pixels") | ||
case .percentage: | ||
Text("\(Image(systemName: "percent")) Percentages") | ||
} | ||
} | ||
|
||
var postscript: String { | ||
switch self { | ||
case .pixels: "px" | ||
case .percentage: "%" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.