Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VPN screen improvements #2550

Merged
merged 33 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
cd4e0e4
Update header
quanganhdo Mar 27, 2024
3a8ebc9
Status badge
quanganhdo Apr 2, 2024
8955662
Merge branch 'main' into anh/netp/screen-improvements
quanganhdo Apr 2, 2024
5926f89
Merge branch 'main' of github.com:duckduckgo/macos-browser into anh/n…
quanganhdo Apr 2, 2024
bf32d19
New assets
quanganhdo Apr 3, 2024
81fcbd4
Add Lottie to VPN target
quanganhdo Apr 3, 2024
cbbd23d
Play lottie animation with intro
quanganhdo Apr 3, 2024
6257eea
Move assets
quanganhdo Apr 3, 2024
2df0228
Use correct size
quanganhdo Apr 3, 2024
ff913e8
Skip intro if not user initiated
quanganhdo Apr 3, 2024
18a73c3
Add Lottie to VPN App Store
quanganhdo Apr 3, 2024
29e84f2
Merge branch 'main' into anh/netp/screen-improvements
quanganhdo Apr 4, 2024
0c9b716
Address warnings
quanganhdo Apr 4, 2024
ea471c5
Bad workaround for popover positioning issue
quanganhdo Apr 5, 2024
c0f64a1
Remove unreliable check
quanganhdo Apr 5, 2024
7206235
Fix typo
quanganhdo Apr 5, 2024
a594d25
Merge branch 'main' into anh/netp/screen-improvements
quanganhdo Apr 8, 2024
f78be2b
Add Lottie to notification target
quanganhdo Apr 8, 2024
1eac1ff
Merge branch 'main' into anh/netp/screen-improvements
quanganhdo Apr 9, 2024
16887a8
Merge branch 'main' into anh/netp/screen-improvements
quanganhdo Apr 9, 2024
7ac9e80
Merge branch 'main' into anh/netp/screen-improvements
quanganhdo Apr 10, 2024
40907ad
Merge branch 'main' into anh/netp/screen-improvements
quanganhdo Apr 12, 2024
2864ba9
VPN screen improvements #2: Location (#2590)
quanganhdo Apr 16, 2024
c7ecdbb
VPN screen improvements #3: Data volume + Menu items (#2611)
quanganhdo Apr 19, 2024
36576f7
Update BSK
quanganhdo Apr 19, 2024
d845726
Merge branch 'main' into anh/netp/screen-improvements
quanganhdo Apr 19, 2024
97b95ec
Merge branch 'main' into anh/netp/screen-improvements
quanganhdo Apr 19, 2024
6cf6f5d
Fix Swiftlint warnings
quanganhdo Apr 19, 2024
e05cc7c
Fix botched merge
quanganhdo Apr 19, 2024
082ac88
Merge branch 'main' into anh/netp/screen-improvements
quanganhdo Apr 19, 2024
bb90b30
Fix broken tests
quanganhdo Apr 19, 2024
ea57352
Fix tests
quanganhdo Apr 19, 2024
1e39ac1
Update BSK
quanganhdo Apr 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3249,6 +3249,17 @@
BBDFDC5A2B2B8A0900F62D90 /* DataBrokerProtectionExternalWaitlistPixels.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBDFDC592B2B8A0900F62D90 /* DataBrokerProtectionExternalWaitlistPixels.swift */; };
BBDFDC5C2B2B8D7000F62D90 /* DataBrokerProtectionExternalWaitlistPixels.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBDFDC592B2B8A0900F62D90 /* DataBrokerProtectionExternalWaitlistPixels.swift */; };
BBDFDC5D2B2B8E2100F62D90 /* DataBrokerProtectionExternalWaitlistPixels.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBDFDC592B2B8A0900F62D90 /* DataBrokerProtectionExternalWaitlistPixels.swift */; };
BD384AC92BBC821A00EF3735 /* vpn-dark-mode.json in Resources */ = {isa = PBXBuildFile; fileRef = BD384AC82BBC821100EF3735 /* vpn-dark-mode.json */; };
BD384ACA2BBC821A00EF3735 /* vpn-light-mode.json in Resources */ = {isa = PBXBuildFile; fileRef = BD384AC72BBC821100EF3735 /* vpn-light-mode.json */; };
BD384ACB2BBC821B00EF3735 /* vpn-dark-mode.json in Resources */ = {isa = PBXBuildFile; fileRef = BD384AC82BBC821100EF3735 /* vpn-dark-mode.json */; };
BD384ACC2BBC821B00EF3735 /* vpn-light-mode.json in Resources */ = {isa = PBXBuildFile; fileRef = BD384AC72BBC821100EF3735 /* vpn-light-mode.json */; };
BD384ACD2BBC821D00EF3735 /* vpn-dark-mode.json in Resources */ = {isa = PBXBuildFile; fileRef = BD384AC82BBC821100EF3735 /* vpn-dark-mode.json */; };
BD384ACE2BBC821D00EF3735 /* vpn-light-mode.json in Resources */ = {isa = PBXBuildFile; fileRef = BD384AC72BBC821100EF3735 /* vpn-light-mode.json */; };
BD8A305D2BC425B000D0669F /* Lottie in Frameworks */ = {isa = PBXBuildFile; productRef = BD8A305C2BC425B000D0669F /* Lottie */; };
BDE981D82BBCE4C700645880 /* Lottie in Frameworks */ = {isa = PBXBuildFile; productRef = BDE981D72BBCE4C700645880 /* Lottie */; };
BDE981D92BBD10D600645880 /* vpn-dark-mode.json in Resources */ = {isa = PBXBuildFile; fileRef = BD384AC82BBC821100EF3735 /* vpn-dark-mode.json */; };
BDE981DA2BBD10D600645880 /* vpn-light-mode.json in Resources */ = {isa = PBXBuildFile; fileRef = BD384AC72BBC821100EF3735 /* vpn-light-mode.json */; };
BDE981DF2BBDBD0100645880 /* Lottie in Frameworks */ = {isa = PBXBuildFile; productRef = BDE981DE2BBDBD0100645880 /* Lottie */; };
C1372EF42BBC5BAD003F8793 /* SecureTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1372EF32BBC5BAD003F8793 /* SecureTextField.swift */; };
C1372EF52BBC5BAD003F8793 /* SecureTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1372EF32BBC5BAD003F8793 /* SecureTextField.swift */; };
C1372EF62BBC5BAD003F8793 /* SecureTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1372EF32BBC5BAD003F8793 /* SecureTextField.swift */; };
Expand Down Expand Up @@ -4763,6 +4774,8 @@
B6FA8940269C425400588ECD /* PrivacyDashboardPopover.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrivacyDashboardPopover.swift; sourceTree = "<group>"; };
BB5789712B2CA70F0009DFE2 /* DataBrokerProtectionSubscriptionEventHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataBrokerProtectionSubscriptionEventHandler.swift; sourceTree = "<group>"; };
BBDFDC592B2B8A0900F62D90 /* DataBrokerProtectionExternalWaitlistPixels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataBrokerProtectionExternalWaitlistPixels.swift; sourceTree = "<group>"; };
BD384AC72BBC821100EF3735 /* vpn-light-mode.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "vpn-light-mode.json"; sourceTree = "<group>"; };
BD384AC82BBC821100EF3735 /* vpn-dark-mode.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "vpn-dark-mode.json"; sourceTree = "<group>"; };
C1372EF32BBC5BAD003F8793 /* SecureTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecureTextField.swift; sourceTree = "<group>"; };
C13909EE2B85FD4E001626ED /* AutofillActionExecutor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutofillActionExecutor.swift; sourceTree = "<group>"; };
C13909F32B85FD79001626ED /* AutofillDeleteAllPasswordsExecutorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutofillDeleteAllPasswordsExecutorTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4920,6 +4933,7 @@
7BEEA5122AD1235B00A9E72B /* NetworkProtectionIPC in Frameworks */,
7BA7CC5F2AD1210C0042E5CE /* Networking in Frameworks */,
7BEEA5162AD1236E00A9E72B /* NetworkProtectionUI in Frameworks */,
BDE981D82BBCE4C700645880 /* Lottie in Frameworks */,
7BFCB74E2ADE7E1A00DA3EA7 /* PixelKit in Frameworks */,
EE7295ED2A545C0A008C0991 /* NetworkProtection in Frameworks */,
EE2F9C5B2B90F2FF00D45FC9 /* Subscription in Frameworks */,
Expand All @@ -4933,6 +4947,7 @@
files = (
7BFCB7502ADE7E2300DA3EA7 /* PixelKit in Frameworks */,
4BCBE45C2BA7E18500FC75A1 /* Subscription in Frameworks */,
BDE981DF2BBDBD0100645880 /* Lottie in Frameworks */,
7BA7CC612AD1211C0042E5CE /* Networking in Frameworks */,
7BEEA5142AD1236300A9E72B /* NetworkProtectionIPC in Frameworks */,
7B00997F2B6508C200FE7C31 /* NetworkProtectionProxy in Frameworks */,
Expand All @@ -4948,6 +4963,7 @@
files = (
7B624F172BA25C1F00A6C544 /* NetworkProtectionUI in Frameworks */,
37269F052B3332C2005E8E46 /* Common in Frameworks */,
BD8A305D2BC425B000D0669F /* Lottie in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -5877,6 +5893,7 @@
4B4D60632A0B29FA00BCD287 /* BothAppTargets */ = {
isa = PBXGroup;
children = (
BDE981DB2BBD110800645880 /* Assets */,
EEA3EEAF2B24EB5100E8333A /* VPNLocation */,
9D9AE8682AA76CDC0026E7DC /* LoginItem+NetworkProtection.swift */,
7BE146062A6A83C700C313B8 /* NetworkProtectionDebugMenu.swift */,
Expand Down Expand Up @@ -8754,6 +8771,15 @@
path = View;
sourceTree = "<group>";
};
BDE981DB2BBD110800645880 /* Assets */ = {
isa = PBXGroup;
children = (
BD384AC82BBC821100EF3735 /* vpn-dark-mode.json */,
BD384AC72BBC821100EF3735 /* vpn-light-mode.json */,
);
path = Assets;
sourceTree = "<group>";
};
C13909F22B85FD60001626ED /* Autofill */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -9090,6 +9116,7 @@
4B41EDAA2B1544B2001EEDF4 /* LoginItems */,
7B00997C2B6508B700FE7C31 /* NetworkProtectionProxy */,
EE2F9C5A2B90F2FF00D45FC9 /* Subscription */,
BDE981D72BBCE4C700645880 /* Lottie */,
);
productName = DuckDuckGoAgent;
productReference = 4B2D06392A11CFBB00DE1F49 /* DuckDuckGo VPN.app */;
Expand Down Expand Up @@ -9123,6 +9150,7 @@
7B00997E2B6508C200FE7C31 /* NetworkProtectionProxy */,
4BA7C4DC2B3F64E500AFE511 /* LoginItems */,
4BCBE45B2BA7E18500FC75A1 /* Subscription */,
BDE981DE2BBDBD0100645880 /* Lottie */,
);
productName = DuckDuckGoAgentAppStore;
productReference = 4B2D06692A13318400DE1F49 /* DuckDuckGo VPN App Store.app */;
Expand All @@ -9146,6 +9174,7 @@
packageProductDependencies = (
37269F042B3332C2005E8E46 /* Common */,
7B624F162BA25C1F00A6C544 /* NetworkProtectionUI */,
BD8A305C2BC425B000D0669F /* Lottie */,
);
productName = DuckDuckGoNotifications;
productReference = 4B4BEC202A11B4E2001D9AC5 /* DuckDuckGo Notifications.app */;
Expand Down Expand Up @@ -9640,7 +9669,9 @@
3706FCE6293F65D500E42796 /* social_images in Resources */,
3706FCE7293F65D500E42796 /* shield-dot-mouse-over.json in Resources */,
3706FCE9293F65D500E42796 /* fb-sdk.js in Resources */,
BD384ACB2BBC821B00EF3735 /* vpn-dark-mode.json in Resources */,
3706FCEA293F65D500E42796 /* PasswordManager.storyboard in Resources */,
BD384ACC2BBC821B00EF3735 /* vpn-light-mode.json in Resources */,
3706FCEB293F65D500E42796 /* dark-flame-mouse-over.json in Resources */,
3706FCEC293F65D500E42796 /* flame-mouse-over.json in Resources */,
3706FCED293F65D500E42796 /* httpsMobileV2Bloom.bin in Resources */,
Expand Down Expand Up @@ -9702,7 +9733,9 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
BDE981DA2BBD10D600645880 /* vpn-light-mode.json in Resources */,
7BA7CC482AD11E5C0042E5CE /* Assets.xcassets in Resources */,
BDE981D92BBD10D600645880 /* vpn-dark-mode.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -9768,7 +9801,9 @@
4B957C1F2AC7AE700062CA31 /* social_images in Resources */,
4B957C202AC7AE700062CA31 /* shield-dot-mouse-over.json in Resources */,
4B957C222AC7AE700062CA31 /* fb-sdk.js in Resources */,
BD384ACD2BBC821D00EF3735 /* vpn-dark-mode.json in Resources */,
4B957C232AC7AE700062CA31 /* PasswordManager.storyboard in Resources */,
BD384ACE2BBC821D00EF3735 /* vpn-light-mode.json in Resources */,
4B957C242AC7AE700062CA31 /* dark-flame-mouse-over.json in Resources */,
4B957C252AC7AE700062CA31 /* flame-mouse-over.json in Resources */,
4B957C262AC7AE700062CA31 /* httpsMobileV2Bloom.bin in Resources */,
Expand Down Expand Up @@ -9883,7 +9918,9 @@
EA18D1CA272F0DC8006DC101 /* social_images in Resources */,
AA7EB6E927E880A600036718 /* shield-dot-mouse-over.json in Resources */,
EAC80DE0271F6C0100BBF02D /* fb-sdk.js in Resources */,
BD384AC92BBC821A00EF3735 /* vpn-dark-mode.json in Resources */,
85625994269C8F9600EE44BC /* PasswordManager.storyboard in Resources */,
BD384ACA2BBC821A00EF3735 /* vpn-light-mode.json in Resources */,
AA7EB6E327E7D05500036718 /* dark-flame-mouse-over.json in Resources */,
AA7EB6E227E7D05500036718 /* flame-mouse-over.json in Resources */,
4B677433255DBEB800025BD8 /* httpsMobileV2Bloom.bin in Resources */,
Expand Down Expand Up @@ -15222,6 +15259,21 @@
package = B6F997B92B8F352500476735 /* XCRemoteSwiftPackageReference "apple-toolbox" */;
productName = "plugin:SwiftLintPlugin";
};
BD8A305C2BC425B000D0669F /* Lottie */ = {
isa = XCSwiftPackageProductDependency;
package = 9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */;
productName = Lottie;
};
BDE981D72BBCE4C700645880 /* Lottie */ = {
isa = XCSwiftPackageProductDependency;
package = 9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */;
productName = Lottie;
};
BDE981DE2BBDBD0100645880 /* Lottie */ = {
isa = XCSwiftPackageProductDependency;
package = 9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */;
productName = Lottie;
};
CBC83E3529B63D380008E19C /* Configuration */ = {
isa = XCSwiftPackageProductDependency;
package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */;
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ final class NetworkProtectionNavBarPopoverManager: NetPPopoverManager {

// swiftlint:disable:next function_body_length
func show(positionedBelow view: NSView, withDelegate delegate: NSPopoverDelegate) {
let popover = networkProtectionPopover ?? {
let popover = {

let controller = NetworkProtectionIPCTunnelController(ipcClient: ipcClient)

Expand Down Expand Up @@ -135,6 +135,7 @@ final class NetworkProtectionNavBarPopoverManager: NetPPopoverManager {
func toggle(positionedBelow view: NSView, withDelegate delegate: NSPopoverDelegate) {
if let networkProtectionPopover, networkProtectionPopover.isShown {
networkProtectionPopover.close()
self.networkProtectionPopover = nil
} else {
let featureVisibility = DefaultNetworkProtectionVisibility()

Expand All @@ -148,5 +149,6 @@ final class NetworkProtectionNavBarPopoverManager: NetPPopoverManager {

func close() {
networkProtectionPopover?.close()
networkProtectionPopover = nil
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// LottieView+withIntro.swift
//
// Copyright © 2024 DuckDuckGo. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import SwiftUI
import Lottie

extension LottieView where Placeholder: View {
public struct LoopWithIntroTiming {
let skipIntro: Bool
let introStartFrame: AnimationFrameTime
let introEndFrame: AnimationFrameTime
let loopStartFrame: AnimationFrameTime
let loopEndFrame: AnimationFrameTime
}

public func playing(withIntro timing: LoopWithIntroTiming, isAnimating: Binding<Bool> = .constant(true)) -> Lottie.LottieView<Placeholder> {
configure { uiView in
if uiView.isAnimationPlaying, !isAnimating.wrappedValue {
uiView.stop()
return
}

guard isAnimating.wrappedValue, !uiView.isAnimationPlaying else { return }

if uiView.loopMode == .playOnce, uiView.currentProgress == 1 { return }

if timing.skipIntro {
uiView.play(fromFrame: timing.loopStartFrame, toFrame: timing.loopEndFrame, loopMode: .loop)
} else {
uiView.play(fromFrame: timing.introStartFrame, toFrame: timing.introEndFrame, loopMode: .playOnce) { _ in
uiView.play(fromFrame: timing.loopStartFrame, toFrame: timing.loopEndFrame, loopMode: .loop)
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
import Foundation

final class UserText {
static let networkProtectionStatusViewFeatureDesc = NSLocalizedString("network.protection.status.view.feature.description", value: "DuckDuckGo's VPN secures all of your device's Internet traffic anytime, anywhere.", comment: "Feature description shown in NetworkProtection's status view.")
static let networkProtectionStatusHeaderMessageOff = NSLocalizedString("network.protection.status.header.message.off", value: "Connect to secure all of your device’s\nInternet traffic.", comment: "Message label text for the status view when VPN is disconnected")
static let networkProtectionStatusHeaderMessageOn = NSLocalizedString("network.protection.status.header.message.on", value: "All device Internet traffic is being secured\nthrough the VPN.", comment: "Message label text for the status view when VPN is connected")
static let networkProtectionStatusViewConnDetails = NSLocalizedString("network.protection.status.view.connection.details", value: "Connection Details", comment: "Connection details label shown in NetworkProtection's status view.")
static let networkProtectionStatusViewConnLabel = NSLocalizedString("network.protection.status.view.connection.label", value: "VPN", comment: "Connection label shown in NetworkProtection's status view.")
static let networkProtectionStatusViewLocation = NSLocalizedString("network.protection.status.view.location", value: "Location", comment: "Location label shown in NetworkProtection's status view.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,17 @@ public final class StatusBarMenu: NSObject {
private let model: StatusBarMenuModel

private let statusItem: NSStatusItem
private let popover: NetworkProtectionPopover
private var popover: NetworkProtectionPopover?

private let controller: TunnelController
private let statusReporter: NetworkProtectionStatusReporter
private let onboardingStatusPublisher: OnboardingStatusPublisher
private let appLauncher: AppLaunching
private let menuItems: () -> [MenuItem]
private let agentLoginItem: LoginItem?
private let isMenuBarStatusView: Bool
private let userDefaults: UserDefaults
private let uninstallHandler: () async -> Void

// MARK: - NetP Icon publisher

Expand Down Expand Up @@ -65,17 +75,15 @@ public final class StatusBarMenu: NSObject {
self.statusItem = statusItem
self.iconPublisher = NetworkProtectionIconPublisher(statusReporter: statusReporter, iconProvider: iconProvider)

popover = NetworkProtectionPopover(controller: controller,
onboardingStatusPublisher: onboardingStatusPublisher,
statusReporter: statusReporter,
appLauncher: appLauncher,
menuItems: menuItems,
agentLoginItem: agentLoginItem,
isMenuBarStatusView: isMenuBarStatusView,
userDefaults: userDefaults,
uninstallHandler: uninstallHandler)

popover.behavior = .transient
self.controller = controller
self.statusReporter = statusReporter
self.onboardingStatusPublisher = onboardingStatusPublisher
self.appLauncher = appLauncher
self.menuItems = menuItems
self.agentLoginItem = agentLoginItem
self.isMenuBarStatusView = isMenuBarStatusView
self.userDefaults = userDefaults
self.uninstallHandler = uninstallHandler

super.init()

Expand Down Expand Up @@ -112,22 +120,34 @@ public final class StatusBarMenu: NSObject {
// MARK: - Popover

private func togglePopover(isOptionKeyPressed: Bool) {
if popover.isShown {
if let popover, popover.isShown {
popover.close()
self.popover = nil
} else {
guard let button = statusItem.button else {
return
}

popover.setShowsDebugInformation(isOptionKeyPressed)
popover.show(relativeTo: button.bounds, of: button, preferredEdge: .maxY)
popover = NetworkProtectionPopover(controller: controller,
onboardingStatusPublisher: onboardingStatusPublisher,
statusReporter: statusReporter,
appLauncher: appLauncher,
menuItems: menuItems,
agentLoginItem: agentLoginItem,
isMenuBarStatusView: isMenuBarStatusView,
userDefaults: userDefaults,
uninstallHandler: uninstallHandler)
quanganhdo marked this conversation as resolved.
Show resolved Hide resolved
popover?.behavior = .transient

popover?.setShowsDebugInformation(isOptionKeyPressed)
popover?.show(relativeTo: button.bounds, of: button, preferredEdge: .minY)
}
}

// MARK: - Context

private func showContextMenu() {
if popover.isShown {
if let popover, popover.isShown {
popover.close()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import Foundation
public enum NetworkProtectionAsset: String, CaseIterable {
case ipAddressIcon = "IP-16"
case serverLocationIcon = "Server-Location-16"
case vpnDisabledImage = "VPN-Disabled-128"
case vpnEnabledImage = "VPN-128"
case vpnDisabledImage = "VPNDisabled"
case vpnEnabledImage = "VPN"
case vpnIcon = "VPN-16"

// Apple Icons
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "Network-Protetion-VPN-128.pdf",
"filename" : "VPN.pdf",
"idiom" : "universal"
}
],
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "Network-Protetion-VPN-Disabled-128.pdf",
"filename" : "VPNDisabled.pdf",
"idiom" : "universal"
}
],
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "vpn-download.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "VPNLocation.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
Loading
Loading