Skip to content

Commit

Permalink
Remove the custom widget background color.
Browse files Browse the repository at this point in the history
  • Loading branch information
samsymons committed Nov 13, 2023
1 parent f3e6881 commit 8163d28
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
10 changes: 10 additions & 0 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -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;
};
Expand Down Expand Up @@ -5443,6 +5445,9 @@
85DF714924F7FE6100C89288 /* PBXTargetDependency */,
);
name = WidgetsExtension;
packageProductDependencies = (
4BBBBA862B02E85400D965DA /* DesignResourcesKit */,
);
productName = WidgetsExtension;
productReference = 8512EA4D24ED30D20073EE19 /* WidgetsExtension.appex */;
productType = "com.apple.product-type.app-extension";
Expand Down Expand Up @@ -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" */;
Expand Down

This file was deleted.

16 changes: 13 additions & 3 deletions Widgets/VPNWidget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import Foundation
import AppIntents
import Core
import DesignResourcesKit
import SwiftUI
import WidgetKit
import NetworkExtension
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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

0 comments on commit 8163d28

Please sign in to comment.