fix: Preference button on toolbar not working on Mac OS 13 Ventura

This commit is contained in:
chedabob 2022-10-05 00:27:08 +01:00
parent 13e829ca88
commit bb8676b620

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")