parent
ae1aa1a268
commit
0c448e7f91
|
@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## 1.17.0 Beta 2831 (2021-10-18)
|
## Unreleased
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"info" : {
|
"info" : {
|
||||||
"version" : 1,
|
"author" : "xcode",
|
||||||
"author" : "xcode"
|
"version" : 1
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "StatusActive@2x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "StatusActive@3x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
|
}
|
||||||
|
}
|
BIN
Passepartout/App/macOS/Assets.xcassets/StatusActive.imageset/StatusActive@2x.png
vendored
Normal file
BIN
Passepartout/App/macOS/Assets.xcassets/StatusActive.imageset/StatusActive@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 798 B |
BIN
Passepartout/App/macOS/Assets.xcassets/StatusActive.imageset/StatusActive@3x.png
vendored
Normal file
BIN
Passepartout/App/macOS/Assets.xcassets/StatusActive.imageset/StatusActive@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
|
@ -1,55 +0,0 @@
|
||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"appearances" : [
|
|
||||||
{
|
|
||||||
"appearance" : "luminosity",
|
|
||||||
"value" : "dark"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "StatusBarButtonImage@2x.png",
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"appearances" : [
|
|
||||||
{
|
|
||||||
"appearance" : "luminosity",
|
|
||||||
"value" : "dark"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename" : "StatusBarButtonImage@3x.png",
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "3x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"appearances" : [
|
|
||||||
{
|
|
||||||
"appearance" : "luminosity",
|
|
||||||
"value" : "dark"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"idiom" : "universal",
|
|
||||||
"scale" : "3x"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
},
|
|
||||||
"properties" : {
|
|
||||||
"template-rendering-intent" : "template"
|
|
||||||
}
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 434 B |
Binary file not shown.
Before Width: | Height: | Size: 493 B |
|
@ -0,0 +1,25 @@
|
||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "StatusPending@2x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "StatusPending@3x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
|
}
|
||||||
|
}
|
BIN
Passepartout/App/macOS/Assets.xcassets/StatusPending.imageset/StatusPending@2x.png
vendored
Normal file
BIN
Passepartout/App/macOS/Assets.xcassets/StatusPending.imageset/StatusPending@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
Passepartout/App/macOS/Assets.xcassets/StatusPending.imageset/StatusPending@3x.png
vendored
Normal file
BIN
Passepartout/App/macOS/Assets.xcassets/StatusPending.imageset/StatusPending@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
|
@ -5,12 +5,12 @@ All notable changes to this project will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## 1.17.0 Beta 2831 (2021-10-18)
|
## Unreleased
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Allow Oeck provider without any purchase.
|
- Allow Oeck provider without any purchase.
|
||||||
- Status bar icon color had to be dropped in order to automatically adjust to desktop background color.
|
- Drop status bar icon color to automatically adjust to desktop background color. [#199](https://github.com/passepartoutvpn/passepartout-apple/issues/199)
|
||||||
- Migrate to SwiftPM.
|
- Migrate to SwiftPM.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -20,7 +20,8 @@ internal typealias AssetImageTypeAlias = ImageAsset.Image
|
||||||
// swiftlint:disable identifier_name line_length nesting type_body_length type_name
|
// swiftlint:disable identifier_name line_length nesting type_body_length type_name
|
||||||
internal enum Asset {
|
internal enum Asset {
|
||||||
internal enum Assets {
|
internal enum Assets {
|
||||||
internal static let statusBarButtonImage = ImageAsset(name: "StatusBarButtonImage")
|
internal static let statusActive = ImageAsset(name: "StatusActive")
|
||||||
|
internal static let statusPending = ImageAsset(name: "StatusPending")
|
||||||
}
|
}
|
||||||
internal enum Flags {
|
internal enum Flags {
|
||||||
internal static let ad = ImageAsset(name: "ad")
|
internal static let ad = ImageAsset(name: "ad")
|
||||||
|
|
|
@ -57,13 +57,9 @@ class StatusMenu: NSObject {
|
||||||
|
|
||||||
// MARK: Button images
|
// MARK: Button images
|
||||||
|
|
||||||
private let imageStatus = Asset.Assets.statusBarButtonImage.image
|
private let imageStatusActive = Asset.Assets.statusActive.image
|
||||||
|
|
||||||
private lazy var imageStatusActive: NSImage = imageStatus.tinted(withColor: Theme.current.palette.colorOn)
|
private let imageStatusPending = Asset.Assets.statusPending.image
|
||||||
|
|
||||||
private lazy var imageStatusInactive: NSImage = imageStatus.tinted(withColor: Theme.current.palette.colorPrimaryText)
|
|
||||||
|
|
||||||
private lazy var imageStatusInProgress: NSImage = imageStatus.tinted(withColor: Theme.current.palette.colorIndeterminate)
|
|
||||||
|
|
||||||
// MARK: Menu references
|
// MARK: Menu references
|
||||||
|
|
||||||
|
@ -97,10 +93,10 @@ class StatusMenu: NSObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
func install() {
|
func install() {
|
||||||
guard let button = statusItem.button else {
|
guard let _ = statusItem.button else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
button.image = imageStatus
|
setStatusImage(for: .inactive)
|
||||||
|
|
||||||
VPN.shared.prepare {
|
VPN.shared.prepare {
|
||||||
self.rebuild()
|
self.rebuild()
|
||||||
|
@ -237,7 +233,7 @@ class StatusMenu: NSObject {
|
||||||
guard let profile = profile else {
|
guard let profile = profile else {
|
||||||
itemProfileName.title = L10n.Menu.ActiveProfile.Title.none
|
itemProfileName.title = L10n.Menu.ActiveProfile.Title.none
|
||||||
// itemProfileName.image = nil
|
// itemProfileName.image = nil
|
||||||
statusItem.button?.image = imageStatusInactive
|
setStatusImage(for: .inactive)
|
||||||
statusItem.button?.toolTip = nil
|
statusItem.button?.toolTip = nil
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -619,22 +615,18 @@ class StatusMenu: NSObject {
|
||||||
|
|
||||||
switch vpn.status ?? .disconnected {
|
switch vpn.status ?? .disconnected {
|
||||||
case .connected:
|
case .connected:
|
||||||
statusItem.button?.image = imageStatusActive
|
setStatusImage(for: .active)
|
||||||
statusItem.button?.alphaValue = 1.0
|
|
||||||
|
|
||||||
Reviewer.shared.reportEvent()
|
Reviewer.shared.reportEvent()
|
||||||
|
|
||||||
case .connecting:
|
case .connecting:
|
||||||
statusItem.button?.image = imageStatusInProgress
|
setStatusImage(for: .pending)
|
||||||
statusItem.button?.alphaValue = 1.0
|
|
||||||
|
|
||||||
case .disconnected:
|
case .disconnected:
|
||||||
statusItem.button?.image = imageStatusInactive
|
setStatusImage(for: .inactive)
|
||||||
statusItem.button?.alphaValue = 0.5
|
|
||||||
|
|
||||||
case .disconnecting:
|
case .disconnecting:
|
||||||
statusItem.button?.image = imageStatusInProgress
|
setStatusImage(for: .pending)
|
||||||
statusItem.button?.alphaValue = 1.0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -686,3 +678,29 @@ extension StatusMenu: ConnectionServiceDelegate {
|
||||||
NotificationCenter.default.post(name: StatusMenu.didUpdateProfile, object: profile)
|
NotificationCenter.default.post(name: StatusMenu.didUpdateProfile, object: profile)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension StatusMenu {
|
||||||
|
fileprivate enum ImageStatus {
|
||||||
|
case active
|
||||||
|
|
||||||
|
case pending
|
||||||
|
|
||||||
|
case inactive
|
||||||
|
}
|
||||||
|
|
||||||
|
fileprivate func setStatusImage(for imageStatus: ImageStatus) {
|
||||||
|
switch imageStatus {
|
||||||
|
case .active:
|
||||||
|
statusItem.button?.image = imageStatusActive
|
||||||
|
statusItem.button?.alphaValue = 1.0
|
||||||
|
|
||||||
|
case .pending:
|
||||||
|
statusItem.button?.image = imageStatusPending
|
||||||
|
statusItem.button?.alphaValue = 1.0
|
||||||
|
|
||||||
|
case .inactive:
|
||||||
|
statusItem.button?.image = imageStatusActive
|
||||||
|
statusItem.button?.alphaValue = 0.5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue