diff options
Diffstat (limited to 'Hotline')
| -rw-r--r-- | Hotline/Application.swift | 27 | ||||
| -rw-r--r-- | Hotline/macOS/ServerView.swift | 3 |
2 files changed, 16 insertions, 14 deletions
diff --git a/Hotline/Application.swift b/Hotline/Application.swift index 8e1b4d9..91f8dac 100644 --- a/Hotline/Application.swift +++ b/Hotline/Application.swift @@ -1,17 +1,16 @@ import SwiftUI import SwiftData -enum ServerWindowDestination: Hashable, Codable { - case server(server: Server) - case none -} - @main struct Application: App { #if os(iOS) private var model = Hotline(trackerClient: HotlineTrackerClient(), client: HotlineClient()) #endif + #if os(macOS) + @Environment(\.openWindow) private var openWindow + #endif + @State private var preferences = Prefs() var body: some Scene { @@ -33,16 +32,16 @@ struct Application: App { .frame(minWidth: 400, minHeight: 300) .environment(preferences) } - .defaultSize(width: 700, height: 800) + .defaultSize(width: 750, height: 700) .defaultPosition(.center) -// .commandsRemoved() -// .commands { -// CommandGroup(before: CommandGroupPlacement.newItem) { -// Button("before item") { -// print("before item") -// } -// } -// } + .commands { + CommandGroup(replacing: CommandGroupPlacement.newItem) { + Button("Connect to Server...") { + openWindow(id: "server") + } + .keyboardShortcut(.init("K"), modifiers: .command) + } + } Settings { SettingsView() diff --git a/Hotline/macOS/ServerView.swift b/Hotline/macOS/ServerView.swift index 7589744..a7dc90d 100644 --- a/Hotline/macOS/ServerView.swift +++ b/Hotline/macOS/ServerView.swift @@ -390,9 +390,12 @@ struct ServerView: View { .toolbar { ToolbarItem(placement: .navigation) { Image(systemName: "globe.americas.fill") + .renderingMode(.template) + .resizable() .scaledToFit() .frame(width: 18) + .opacity(controlActiveState == .inactive ? 0.4 : 1.0) } } } |