Add Toggle Sidebar button for macOS

This commit is contained in:
Arkadiusz Fal 2022-01-02 20:32:42 +01:00
parent 2a75d0a1d4
commit f0d1b74e34

View File

@ -100,6 +100,16 @@ struct AppSidebarNavigation: View {
"Current User: \(accounts.current?.description ?? "Not set")"
)
}
#if os(macOS)
ToolbarItem(placement: .navigation) {
Button {
NSApp.keyWindow?.firstResponder?.tryToPerform(#selector(NSSplitViewController.toggleSidebar(_:)), with: nil)
} label: {
Label("Toggle Sidebar", systemImage: "sidebar.left")
}
}
#endif
}
}