diff options
| -rw-r--r-- | Hotline/macOS/HotlinePanelView.swift | 3 | ||||
| -rw-r--r-- | Hotline/macOS/ServerView.swift | 6 | ||||
| -rw-r--r-- | Hotline/macOS/TrackerView.swift | 3 |
3 files changed, 7 insertions, 5 deletions
diff --git a/Hotline/macOS/HotlinePanelView.swift b/Hotline/macOS/HotlinePanelView.swift index 9915e49..374e379 100644 --- a/Hotline/macOS/HotlinePanelView.swift +++ b/Hotline/macOS/HotlinePanelView.swift @@ -16,8 +16,7 @@ struct HotlinePanelView: View { HStack(spacing: 16) { Button { - if let event = NSApp.currentEvent, - event.modifierFlags.contains(.option) { + if NSEvent.modifierFlags.contains(.option) { openWindow(id: "server") } else { diff --git a/Hotline/macOS/ServerView.swift b/Hotline/macOS/ServerView.swift index e342f73..89f353b 100644 --- a/Hotline/macOS/ServerView.swift +++ b/Hotline/macOS/ServerView.swift @@ -224,7 +224,11 @@ struct ServerView: View { connectAddress = server.address connectLogin = server.login connectPassword = server.password - connectToServer() + + // Connect to server automatically unless the option key is held down. + if !NSEvent.modifierFlags.contains(.option) { + connectToServer() + } } .focusedSceneValue(\.activeHotlineModel, model) .focusedSceneValue(\.activeServerState, state) diff --git a/Hotline/macOS/TrackerView.swift b/Hotline/macOS/TrackerView.swift index 5ab4c65..ad0b08c 100644 --- a/Hotline/macOS/TrackerView.swift +++ b/Hotline/macOS/TrackerView.swift @@ -122,8 +122,7 @@ struct TrackerView: View { } if clickedItem.type == .tracker { - if let event = NSApp.currentEvent, - event.modifierFlags.contains(.option) { + if NSEvent.modifierFlags.contains(.option) { trackerSheetBookmark = clickedItem } else { |