Skip to content

Commit 5b18a90

Browse files
authored
Merge pull request #444 from XcodesOrg/matt/SettingsLinkSonoma
fix: settings link on Sonoma not working
2 parents 1bd5017 + b9dc7bf commit 5b18a90

2 files changed

Lines changed: 19 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ on:
88

99
jobs:
1010
test:
11-
runs-on: macos-12
11+
runs-on: macos-13
1212
steps:
1313
- uses: actions/checkout@v4
1414
- name: Run tests
1515
env:
16-
DEVELOPER_DIR: /Applications/Xcode_14.2.app
16+
DEVELOPER_DIR: /Applications/Xcode_15.0.1.app
1717
run: xcodebuild test -scheme Xcodes

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)