Skip to content

Commit

Permalink
Update to NavigationSplitView for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
BPerlakiH committed Sep 29, 2024
1 parent 5c83797 commit b127452
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions App/App_macOS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ struct RootView: View {
private let tabCloses = NotificationCenter.default.publisher(for: NSWindow.willCloseNotification)

var body: some View {
NavigationView {
NavigationSplitView {
List(selection: $navigation.currentItem) {
ForEach(primaryItems, id: \.self) { navigationItem in
Label(navigationItem.name, systemImage: navigationItem.icon)
Expand All @@ -124,14 +124,7 @@ struct RootView: View {
}
}
.frame(minWidth: 150)
.toolbar {
Button {
guard let responder = NSApp.keyWindow?.firstResponder else { return }
responder.tryToPerform(#selector(NSSplitViewController.toggleSidebar(_:)), with: nil)
} label: {
Image(systemName: "sidebar.leading")
}.help("app_macos_navigation.show_sidebar".localized)
}
} detail: {
switch navigation.currentItem {
case .loading:
LoadingView()
Expand Down

0 comments on commit b127452

Please sign in to comment.