Merge pull request #303 from chedabob/FixPreferencesButtonVentura

fix: Preference button on toolbar not working on Mac OS 13 Ventura
This commit is contained in:
Matt Kiazyk 2022-11-03 23:08:09 -05:00 committed by GitHub
commit cf03241320
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,7 +86,13 @@ struct MainToolbarModifier: ViewModifier {
.keyboardShortcut(KeyboardShortcut("i", modifiers: [.command, .option]))
.help("InfoDescription")
Button(action: { NSApp.sendAction(Selector(("showPreferencesWindow:")), to: nil, from: nil) }, label: {
Button(action: {
if #available(macOS 13, *) {
NSApp.sendAction(Selector(("showSettingsWindow:")), to: nil, from: nil)
} else {
NSApp.sendAction(Selector(("showPreferencesWindow:")), to: nil, from: nil)
}
}, label: {
Label("Preferences", systemImage: "gearshape")
})
.help("PreferencesDescription")