diff --git a/Hotline/MacApp.swift b/Hotline/MacApp.swift index f72bdcbe..bc443de4 100644 --- a/Hotline/MacApp.swift +++ b/Hotline/MacApp.swift @@ -110,6 +110,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele } } + @main struct Application: App { @Environment(\.scenePhase) private var scenePhase @@ -318,6 +319,14 @@ struct Application: App { } .keyboardShortcut(.init("K"), modifiers: .command) } + CommandGroup(replacing: .sidebar) { + Button("Show Sidebar") { + withAnimation { + activeServerState?.columnVisibility = .all + } + } + .keyboardShortcut("S", modifiers: [.command, .option]) + } CommandGroup(before: .singleWindowList) { Button("Toolbar") { self.toggleBannerWindow() @@ -507,4 +516,3 @@ struct Application: App { } } } - diff --git a/Hotline/State/ServerState.swift b/Hotline/State/ServerState.swift index 10ffabb3..f36f17e7 100644 --- a/Hotline/State/ServerState.swift +++ b/Hotline/State/ServerState.swift @@ -5,6 +5,7 @@ class ServerState: Equatable { var id: UUID = UUID() var selection: ServerNavigationType var serverName: String? = nil + var columnVisibility: NavigationSplitViewVisibility = .all var accountsShown: Bool = false var broadcastShown: Bool = false var fileNavigationPath: [String]? = nil diff --git a/Hotline/macOS/ServerView.swift b/Hotline/macOS/ServerView.swift index 9598cac4..73b55643 100644 --- a/Hotline/macOS/ServerView.swift +++ b/Hotline/macOS/ServerView.swift @@ -413,7 +413,7 @@ struct ServerView: View { } var serverView: some View { - NavigationSplitView { + NavigationSplitView(columnVisibility: self.$state.columnVisibility) { self.navigationList .navigationSplitViewColumnWidth(200) // .navigationSplitViewColumnWidth(min: 150, ideal: 200, max: 400)