macOS widgets
This commit is contained in:
parent
0ba0c3f7ec
commit
922b8794bc
|
|
@ -165,7 +165,7 @@ struct Provider: IntentTimelineProvider {
|
||||||
|
|
||||||
var dateComponents = calendar.dateComponents([.year, .month, .day], from: Date())
|
var dateComponents = calendar.dateComponents([.year, .month, .day], from: Date())
|
||||||
|
|
||||||
if (dateRange == "all") {
|
if (dateRange == "all_time") {
|
||||||
start = calendar.date(byAdding: .year, value: -100, to: Date())!
|
start = calendar.date(byAdding: .year, value: -100, to: Date())!
|
||||||
} else if (dateRange == "today") {
|
} else if (dateRange == "today") {
|
||||||
start = calendar.startOfDay(for: Date())
|
start = calendar.startOfDay(for: Date())
|
||||||
|
|
@ -261,11 +261,11 @@ struct SimpleEntry: TimelineEntry {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct DashboardWidgetEntryView : View {
|
struct DashboardWidgetEntryView : View {
|
||||||
|
@Environment(\.colorScheme) var colorScheme
|
||||||
var entry: Provider.Entry
|
var entry: Provider.Entry
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
//Rectangle().fill(BackgroundStyle())
|
|
||||||
Rectangle().fill(Color.blue)
|
Rectangle().fill(Color.blue)
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
|
|
||||||
|
|
@ -274,18 +274,21 @@ struct DashboardWidgetEntryView : View {
|
||||||
Text(entry.field)
|
Text(entry.field)
|
||||||
.font(.body)
|
.font(.body)
|
||||||
.bold()
|
.bold()
|
||||||
|
.lineLimit(2)
|
||||||
|
.multilineTextAlignment(.center)
|
||||||
.foregroundColor(Color.blue)
|
.foregroundColor(Color.blue)
|
||||||
|
|
||||||
Text(entry.value)
|
Text(entry.value)
|
||||||
.font(.title)
|
.font(.title)
|
||||||
.privacySensitive()
|
.privacySensitive()
|
||||||
.foregroundColor(Color.gray)
|
.lineLimit(2)
|
||||||
|
//.foregroundColor(Color.gray)
|
||||||
.minimumScaleFactor(0.8)
|
.minimumScaleFactor(0.8)
|
||||||
}
|
}
|
||||||
.padding(.all)
|
.padding(.all)
|
||||||
|
|
||||||
}
|
}
|
||||||
.padding(.top, 8)
|
.padding([.top, .bottom], 8)
|
||||||
.background(ContainerRelativeShape().fill(Color(.white)))
|
.background(ContainerRelativeShape().fill(Color(colorScheme == .dark ? .black : .white)))
|
||||||
//.shadow(color: .gray, radius: 4, x: 4, y: 4)
|
//.shadow(color: .gray, radius: 4, x: 4, y: 4)
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue