Skip to content

Commit

Permalink
Preferences -> Settings
Browse files Browse the repository at this point in the history
  • Loading branch information
tekezo committed Jul 16, 2023
1 parent ffb5eb5 commit dc92e1f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/Tinkle/swift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
_: NSApplication,
hasVisibleWindows _: Bool
) -> Bool {
showPreferences(sender: self)
showSettings(sender: self)
return true
}

Expand Down Expand Up @@ -126,8 +126,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
menu.addItem(NSMenuItem.separator())

menu.addItem(
withTitle: "Preferences...",
action: #selector(showPreferences),
withTitle: "Settings...",
action: #selector(showSettings),
keyEquivalent: ""
)

Expand All @@ -149,7 +149,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
statusBarItem?.isVisible = UserSettings.shared.showMenu
}

@objc func showPreferences(sender _: AnyObject?) {
@objc func showSettings(sender _: AnyObject?) {
PreferencesWindowManager.shared.show()
}

Expand Down
2 changes: 1 addition & 1 deletion src/Tinkle/swift/PreferencesWindowManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class PreferencesWindowManager: NSObject {
)

preferencesWindow!.isReleasedWhenClosed = false
preferencesWindow!.title = "Tinkle Preferences"
preferencesWindow!.title = "Tinkle Settings"
if !UIElement.isProcessTrusted() {
preferencesWindow!.contentView = NSHostingView(rootView: AccessibilityAlertView())
} else {
Expand Down
9 changes: 5 additions & 4 deletions src/Tinkle/swift/Views/AccessibilityAlertView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ struct AccessibilityAlertView: View {
Text("User approval for using accessibility features is required.")
Text("Tinkle uses the feature to detect the focused window changes.")

Text("Open System Preferences > Security & Privacy, then turn on Tinkle.").padding(
.top, 20.0)
Text("Open System Settings > Privacy & Security > Accessibility, then turn on Tinkle.")
.padding(
.top, 20.0)
Button(action: {
NSWorkspace.shared.open(
URL(string: "x-apple.systempreferences:com.apple.preference.security?Privacy")!)
URL(string: "x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility")!)
}) {
Label(
"Open Security & Privacy System Preferences...",
"Open System Settings > Privacy & Security > Accessibility...",
systemImage: "arrow.forward.circle.fill")
}

Expand Down

0 comments on commit dc92e1f

Please sign in to comment.