macOS widgets

This commit is contained in:
Hillel Coren 2023-06-26 18:04:29 +03:00
parent 28d4ad8af3
commit a1fa7a9f73
1 changed files with 6 additions and 3 deletions

View File

@ -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()