-
-
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 #129 from
MrKai77/101-respect-stage-manager
✨ #101 Respect Stage Manager
- Loading branch information
Showing
7 changed files
with
95 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// StageManager.swift | ||
// Loop | ||
// | ||
// Created by Kai Azim on 2023-12-24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
class StageManager { | ||
private static let windowManagerDefaults = UserDefaults(suiteName: "com.apple.WindowManager") | ||
private static let dockDefaults = UserDefaults(suiteName: "com.apple.dock") | ||
|
||
static var available: Bool { | ||
guard #available(macOS 13, *) else { | ||
return false | ||
} | ||
return true | ||
} | ||
|
||
static var enabled: Bool { | ||
guard let value = windowManagerDefaults?.object(forKey: "GloballyEnabled") as? Bool else { | ||
return false | ||
} | ||
return value | ||
} | ||
|
||
static var shown: Bool { | ||
guard let value = windowManagerDefaults?.object(forKey: "AutoHide") as? Bool else { | ||
return false | ||
} | ||
return !value | ||
} | ||
|
||
static var position: Edge { | ||
guard let value = dockDefaults?.object(forKey: "orientation") as? String else { | ||
return .leading | ||
} | ||
return value == "left" ? .trailing : .leading | ||
} | ||
} |
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