From a1fa7a9f73891bb4bba44ebf1510d45919cea141 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 26 Jun 2023 18:04:29 +0300 Subject: [PATCH] macOS widgets --- macos/DashboardWidget/DashboardWidget.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/macos/DashboardWidget/DashboardWidget.swift b/macos/DashboardWidget/DashboardWidget.swift index ed8a23124..a4c8184a9 100644 --- a/macos/DashboardWidget/DashboardWidget.swift +++ b/macos/DashboardWidget/DashboardWidget.swift @@ -290,11 +290,14 @@ struct DashboardWidgetEntryView : View { @Environment(\.colorScheme) var colorScheme var entry: Provider.Entry - + var accentColor: Color { + let companyId = entry.configuration.company?.identifier ?? "" + return Color(hex: (entry.widgetData?.companies[companyId]!.accentColor)!) + } var body: some View { ZStack { - //Rectangle().fill(Color(hex: (entry.widgetData?.companies[entry.configuration.company?.identifier ?? ""]!.accentColor)!)) + Rectangle().fill(accentColor) VStack(alignment: .leading) { HStack { @@ -304,7 +307,7 @@ struct DashboardWidgetEntryView : View { .bold() .lineLimit(2) .multilineTextAlignment(.center) - //.foregroundColor(Color(hex: (entry.widgetData?.companies[(entry.configuration.company?.identifier)!]!.accentColor)!)) + .foregroundColor(accentColor) Text(entry.value) .font(.title) .privacySensitive()