mirror of
https://github.com/yattee/yattee.git
synced 2026-11-04 02:47:18 +00:00
Open Settings from yattee://settings
SettingsView owns its navigation stack, so pushing it onto a section's stack rendered nothing. Select the Settings section where the layout has one, otherwise present Home's settings sheet; open the Settings window on macOS.
This commit is contained in:
@@ -9,6 +9,9 @@ import SwiftUI
|
||||
|
||||
struct ContentView: View {
|
||||
@Environment(\.appEnvironment) private var appEnvironment
|
||||
#if os(macOS)
|
||||
@Environment(\.openWindow) private var openWindow
|
||||
#endif
|
||||
|
||||
var body: some View {
|
||||
Group {
|
||||
@@ -79,6 +82,9 @@ struct ContentView: View {
|
||||
ExpandedPlayerWindowManager.shared.endInlineOverlay()
|
||||
}
|
||||
}
|
||||
.onChange(of: appEnvironment.navigationCoordinator.openSettingsWindowRequest) { _, _ in
|
||||
openWindow(id: "settings")
|
||||
}
|
||||
.onChange(of: appEnvironment.navigationCoordinator.playerExpandTrigger) { _, _ in
|
||||
if appEnvironment.settingsManager.macPlayerSeparateWindow {
|
||||
presentExpandedPlayerWindow(appEnvironment: appEnvironment)
|
||||
|
||||
Reference in New Issue
Block a user