mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Add toolbar button and menu entry to toggle sidebar
This commit is contained in:
parent
1215a1727a
commit
39ae839052
@ -5,7 +5,19 @@ struct ContentView: View {
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
#if os(macOS)
|
||||
SidebarView()
|
||||
.toolbar {
|
||||
Button(action: {
|
||||
NSApp.keyWindow?.contentViewController?.tryToPerform(
|
||||
#selector(NSSplitViewController.toggleSidebar(_:)),
|
||||
with: nil
|
||||
)
|
||||
}, label: { Image(systemName: "sidebar.left") })
|
||||
}
|
||||
#else
|
||||
SidebarView()
|
||||
#endif
|
||||
|
||||
PostListView(selectedCollection: nil, showAllPosts: model.account.isLoggedIn)
|
||||
|
||||
|
@ -22,6 +22,9 @@ struct WriteFreely_MultiPlatformApp: App {
|
||||
.environment(\.managedObjectContext, LocalStorageManager.persistentContainer.viewContext)
|
||||
// .preferredColorScheme(preferences.selectedColorScheme) // See PreferencesModel for info.
|
||||
}
|
||||
.commands {
|
||||
SidebarCommands()
|
||||
}
|
||||
|
||||
#if os(macOS)
|
||||
Settings {
|
||||
|
Loading…
Reference in New Issue
Block a user