Skip to content

Commit 19f1fd8

Browse files
committed
fix: settings link on Sonoma not working
1 parent 75ae0ab commit 19f1fd8

1 file changed

Lines changed: 17 additions & 10 deletions

File tree

Xcodes/Frontend/XcodeList/MainToolbar.swift

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,23 @@ struct MainToolbarModifier: ViewModifier {
8686
.keyboardShortcut(KeyboardShortcut("i", modifiers: [.command, .option]))
8787
.help("InfoDescription")
8888

89-
Button(action: {
90-
if #available(macOS 13, *) {
91-
NSApp.sendAction(Selector(("showSettingsWindow:")), to: nil, from: nil)
92-
} else {
93-
NSApp.sendAction(Selector(("showPreferencesWindow:")), to: nil, from: nil)
94-
}
95-
}, label: {
96-
Label("Preferences", systemImage: "gearshape")
97-
})
98-
.help("PreferencesDescription")
89+
if #available(macOS 14, *) {
90+
SettingsLink(label: {
91+
Label("Preferences", systemImage: "gearshape")
92+
})
93+
.help("PreferencesDescription")
94+
} else {
95+
Button(action: {
96+
if #available(macOS 13, *) {
97+
NSApp.sendAction(Selector(("showSettingsWindow:")), to: nil, from: nil)
98+
} else {
99+
NSApp.sendAction(Selector(("showPreferencesWindow:")), to: nil, from: nil)
100+
}
101+
}, label: {
102+
Label("Preferences", systemImage: "gearshape")
103+
})
104+
.help("PreferencesDescription")
105+
}
99106

100107
TextField("Search", text: $searchText)
101108
.textFieldStyle(RoundedBorderTextFieldStyle())

0 commit comments

Comments
 (0)