mirror of
https://github.com/yattee/yattee.git
synced 2026-05-14 11:25:02 +00:00
Open Settings in a dedicated resizable macOS window
This commit is contained in:
@@ -17,14 +17,20 @@ struct FileCommands: Commands {
|
||||
}
|
||||
.keyboardShortcut("o", modifiers: [.command])
|
||||
}
|
||||
#if os(macOS)
|
||||
CommandGroup(replacing: .appSettings) {
|
||||
Button(String(localized: "menu.app.settings")) {
|
||||
NotificationCenter.default.post(name: .showSettings, object: nil)
|
||||
}
|
||||
.keyboardShortcut(",", modifiers: [.command])
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if os(macOS)
|
||||
/// App menu Settings… item that opens the dedicated Settings window.
|
||||
struct SettingsWindowMenuItem: View {
|
||||
@Environment(\.openWindow) private var openWindow
|
||||
|
||||
var body: some View {
|
||||
Button(String(localized: "menu.app.settings")) {
|
||||
openWindow(id: "settings")
|
||||
}
|
||||
.keyboardShortcut(",", modifiers: [.command])
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user