mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Use native SwiftUI SidebarCommands() for toggle-sidebar menu item
This commit is contained in:
parent
7902bff33d
commit
c1be327694
@ -40,15 +40,7 @@ struct WriteFreely_MultiPlatformApp: App {
|
|||||||
.keyboardShortcut("r", modifiers: [.command])
|
.keyboardShortcut("r", modifiers: [.command])
|
||||||
}
|
}
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
CommandGroup(after: .sidebar) {
|
SidebarCommands()
|
||||||
Button("Toggle Sidebar") {
|
|
||||||
NSApp.keyWindow?.contentViewController?.tryToPerform(
|
|
||||||
#selector(NSSplitViewController.toggleSidebar(_:)), with: nil
|
|
||||||
)
|
|
||||||
withAnimation { self.sidebarIsHidden.toggle() }
|
|
||||||
}
|
|
||||||
.keyboardShortcut("s", modifiers: [.command, .option])
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user