From 8163d289f95c52449c30e10d87a2158a13a5d493 Mon Sep 17 00:00:00 2001 From: Sam Symons Date: Mon, 13 Nov 2023 15:29:58 -0800 Subject: [PATCH] Remove the custom widget background color. --- DuckDuckGo.xcodeproj/project.pbxproj | 10 ++++++++++ .../Contents.json | 20 ------------------- Widgets/VPNWidget.swift | 16 ++++++++++++--- 3 files changed, 23 insertions(+), 23 deletions(-) delete mode 100644 Widgets/Assets.xcassets/DeprecatedColors/VPNWidgetConnectedColor.colorset/Contents.json diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index e6c0a7808e..0a6878724b 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -295,6 +295,7 @@ 4B83397529AFBCE6003F7EA9 /* AppTrackingProtectionFeedbackModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B83397429AFBCE6003F7EA9 /* AppTrackingProtectionFeedbackModelTests.swift */; }; 4B948E2629DCCDB9002531FA /* Persistence in Frameworks */ = {isa = PBXBuildFile; productRef = 4B948E2529DCCDB9002531FA /* Persistence */; }; 4BB7CBB02AF59C310014A35F /* VPNWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BB7CBAF2AF59C310014A35F /* VPNWidget.swift */; }; + 4BBBBA872B02E85400D965DA /* DesignResourcesKit in Frameworks */ = {isa = PBXBuildFile; productRef = 4BBBBA862B02E85400D965DA /* DesignResourcesKit */; }; 4BC21A2F27238B7500229F0E /* RunLoopExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BC21A2C272388BD00229F0E /* RunLoopExtensionTests.swift */; }; 4BC6DD1C2A60E6AD001EC129 /* ReportBrokenSiteView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BC6DD1B2A60E6AD001EC129 /* ReportBrokenSiteView.swift */; }; 4BE2756827304F57006B20B0 /* URLRequestExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BE27566272F878F006B20B0 /* URLRequestExtension.swift */; }; @@ -2593,6 +2594,7 @@ 8512EA5124ED30D20073EE19 /* SwiftUI.framework in Frameworks */, 85DF714624F7FE6100C89288 /* Core.framework in Frameworks */, 8512EA4F24ED30D20073EE19 /* WidgetKit.framework in Frameworks */, + 4BBBBA872B02E85400D965DA /* DesignResourcesKit in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -5443,6 +5445,9 @@ 85DF714924F7FE6100C89288 /* PBXTargetDependency */, ); name = WidgetsExtension; + packageProductDependencies = ( + 4BBBBA862B02E85400D965DA /* DesignResourcesKit */, + ); productName = WidgetsExtension; productReference = 8512EA4D24ED30D20073EE19 /* WidgetsExtension.appex */; productType = "com.apple.product-type.app-extension"; @@ -9227,6 +9232,11 @@ package = 98A16C2928A11BDE00A6C003 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; productName = Persistence; }; + 4BBBBA862B02E85400D965DA /* DesignResourcesKit */ = { + isa = XCSwiftPackageProductDependency; + package = F42D541B29DCA40B004C4FF1 /* XCRemoteSwiftPackageReference "DesignResourcesKit" */; + productName = DesignResourcesKit; + }; 851481872A600EFC00ABC65F /* RemoteMessaging */ = { isa = XCSwiftPackageProductDependency; package = 98A16C2928A11BDE00A6C003 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */; diff --git a/Widgets/Assets.xcassets/DeprecatedColors/VPNWidgetConnectedColor.colorset/Contents.json b/Widgets/Assets.xcassets/DeprecatedColors/VPNWidgetConnectedColor.colorset/Contents.json deleted file mode 100644 index 88545e1a94..0000000000 --- a/Widgets/Assets.xcassets/DeprecatedColors/VPNWidgetConnectedColor.colorset/Contents.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "colors" : [ - { - "color" : { - "color-space" : "srgb", - "components" : { - "alpha" : "1.000", - "blue" : "0xE7", - "green" : "0x68", - "red" : "0x44" - } - }, - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Widgets/VPNWidget.swift b/Widgets/VPNWidget.swift index d1ff2abc56..c7a7681d5b 100644 --- a/Widgets/VPNWidget.swift +++ b/Widgets/VPNWidget.swift @@ -20,6 +20,7 @@ import Foundation import AppIntents import Core +import DesignResourcesKit import SwiftUI import WidgetKit import NetworkExtension @@ -138,7 +139,7 @@ struct VPNStatusView: View { case .status(let status): switch status { case .connecting, .connected, .reasserting: - Color("VPNWidgetConnectedColor") + Color.vpnWidgetBackgroundColor case .disconnecting, .disconnected, .invalid: Color.white @unknown default: @@ -176,7 +177,7 @@ struct VPNStatusView: View { .font(.system(size: 15, weight: .medium)) .fontWeight(.semibold) } - .foregroundStyle(Color("VPNWidgetConnectedColor")) + .foregroundStyle(Color.vpnWidgetBackgroundColor) .buttonStyle(.borderedProminent) .tint(.white) .disabled(status != .connected) @@ -190,7 +191,7 @@ struct VPNStatusView: View { } .foregroundStyle(.white) .buttonStyle(.borderedProminent) - .tint(Color("VPNWidgetConnectedColor")) + .tint(Color.vpnWidgetBackgroundColor) .disabled(status != .disconnected) .padding(.top, 6) .padding(.bottom, 16) @@ -288,4 +289,13 @@ struct VPNStatusView_Previews: PreviewProvider { } +extension Color { + + static var vpnWidgetBackgroundColor: Color { + let color = UIColor(designSystemColor: .accent).resolvedColor(with: UITraitCollection(userInterfaceStyle: .light)) + return Color(color) + } + +} + #endif