diff --git a/Passepartout/App/Descriptible.swift b/Passepartout/App/Descriptible.swift index 0900a0db..a8646e4c 100644 --- a/Passepartout/App/Descriptible.swift +++ b/Passepartout/App/Descriptible.swift @@ -154,3 +154,21 @@ extension DNSProtocol: CustomStringConvertible { } } } + +extension VPNStatus: UIDescriptible { + public var uiDescription: String { + switch self { + case .connecting: + return L10n.Core.Vpn.connecting + + case .connected: + return L10n.Core.Vpn.active + + case .disconnecting: + return L10n.Core.Vpn.disconnecting + + case .disconnected: + return L10n.Core.Vpn.inactive + } + } +} diff --git a/Passepartout/App/macOS/CHANGELOG.md b/Passepartout/App/macOS/CHANGELOG.md index 4e9b2838..8aad3a76 100644 --- a/Passepartout/App/macOS/CHANGELOG.md +++ b/Passepartout/App/macOS/CHANGELOG.md @@ -11,11 +11,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Country flags in provider infrastructure menu. - Support DNS over HTTPS/TLS in "Network settings". [#91](https://github.com/passepartoutvpn/passepartout-apple/issues/91) +- Menu tooltip describing active profile and status. ### Changed - Rendering of provider infrastructures. - Rendering of profile configuration. +- Color-blind friendly menu icon. ### Fixed diff --git a/Passepartout/App/macOS/Menu/StatusMenu.swift b/Passepartout/App/macOS/Menu/StatusMenu.swift index 120b010f..b1455676 100644 --- a/Passepartout/App/macOS/Menu/StatusMenu.swift +++ b/Passepartout/App/macOS/Menu/StatusMenu.swift @@ -215,10 +215,11 @@ class StatusMenu: NSObject { itemToggleVPN = nil itemReconnectVPN = nil statusItem.button?.image = imageStatusInactive + statusItem.button?.toolTip = nil return } - - itemProfileName?.title = service.screenTitle(ProfileKey(profile)) + let profileTitle = service.screenTitle(ProfileKey(profile)) + itemProfileName?.title = profileTitle // itemProfileName?.image = profile.image let needsCredentials = service.needsCredentials(for: profile) @@ -548,6 +549,13 @@ class StatusMenu: NSObject { itemToggleVPN?.title = L10n.App.Service.Cells.Vpn.TurnOn.caption itemToggleVPN?.action = #selector(enableVPN) } + if let profile = service.activeProfile { + let profileTitle = service.screenTitle(ProfileKey(profile)) + statusItem.button?.toolTip = "\(GroupConstants.App.name)\n\(profileTitle)\n\((vpn.status ?? .disconnected).uiDescription)" + } else { + statusItem.button?.toolTip = nil + } + statusItem.button?.alphaValue = 1.0 switch vpn.status ?? .disconnected { case .connected: @@ -560,6 +568,7 @@ class StatusMenu: NSObject { case .disconnected: statusItem.button?.image = imageStatusInactive + statusItem.button?.alphaValue = 0.5 case .disconnecting: statusItem.button?.image = imageStatusInProgress