feat: allow quitting finder for power users (closes #1328)
This commit is contained in:
1 parent
02590579df
commit
9e46bd8e2c
2 files changed
+4
-1
No files matched your search
@@ -64,6 +64,9 @@ class Preferences {
|
||||
"hideThumbnails": "false",
|
||||
]
|
||||
|
||||
// system preferences
|
||||
static var finderShowsQuitMenuItem: Bool { UserDefaults(suiteName: "com.apple.Finder")?.bool(forKey: "QuitMenuItem") ?? false }
|
||||
|
||||
// constant values
|
||||
// not exposed as preferences now but may be in the future, probably through macro preferences
|
||||
static var windowMaterial: NSVisualEffectView.Material { .dark }
|
||||
|
||||
@@ -128,7 +128,7 @@ class Window {
|
||||
|
||||
func quitApp() {
|
||||
// prevent users from quitting Finder
|
||||
if application.runningApplication.bundleIdentifier == "com.apple.finder" { return }
|
||||
if application.runningApplication.bundleIdentifier == "com.apple.finder" && !Preferences.finderShowsQuitMenuItem { return }
|
||||
BackgroundWork.accessibilityCommandsQueue.asyncWithCap { [weak self] in
|
||||
self?.application.runningApplication.terminate()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user