From c1be3276945d5d8cfd80389173ccfc7bd444fc50 Mon Sep 17 00:00:00 2001 From: Angelo Stavrow Date: Tue, 1 Dec 2020 09:55:11 -0500 Subject: [PATCH] Use native SwiftUI SidebarCommands() for toggle-sidebar menu item --- Shared/WriteFreely_MultiPlatformApp.swift | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Shared/WriteFreely_MultiPlatformApp.swift b/Shared/WriteFreely_MultiPlatformApp.swift index a8ecb42..a70e0d5 100644 --- a/Shared/WriteFreely_MultiPlatformApp.swift +++ b/Shared/WriteFreely_MultiPlatformApp.swift @@ -40,15 +40,7 @@ struct WriteFreely_MultiPlatformApp: App { .keyboardShortcut("r", modifiers: [.command]) } #if os(macOS) - CommandGroup(after: .sidebar) { - Button("Toggle Sidebar") { - NSApp.keyWindow?.contentViewController?.tryToPerform( - #selector(NSSplitViewController.toggleSidebar(_:)), with: nil - ) - withAnimation { self.sidebarIsHidden.toggle() } - } - .keyboardShortcut("s", modifiers: [.command, .option]) - } + SidebarCommands() #endif }