|
@@ -368,6 +368,8 @@ extension Home {
|
|
|
var legendPanel: some View {
|
|
var legendPanel: some View {
|
|
|
ZStack {
|
|
ZStack {
|
|
|
HStack(alignment: .center) {
|
|
HStack(alignment: .center) {
|
|
|
|
|
+ Spacer()
|
|
|
|
|
+
|
|
|
Group {
|
|
Group {
|
|
|
Circle().fill(Color.loopGreen).frame(width: 8, height: 8)
|
|
Circle().fill(Color.loopGreen).frame(width: 8, height: 8)
|
|
|
Text("BG")
|
|
Text("BG")
|
|
@@ -385,6 +387,13 @@ extension Home {
|
|
|
Text("ZT")
|
|
Text("ZT")
|
|
|
.font(.system(size: 12, weight: .bold)).foregroundColor(.zt)
|
|
.font(.system(size: 12, weight: .bold)).foregroundColor(.zt)
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ Spacer()
|
|
|
|
|
+
|
|
|
|
|
+ loopView.padding(.top, 16)
|
|
|
|
|
+
|
|
|
|
|
+ Spacer()
|
|
|
|
|
+
|
|
|
Group {
|
|
Group {
|
|
|
Circle().fill(Color.loopYellow).frame(width: 8, height: 8)
|
|
Circle().fill(Color.loopYellow).frame(width: 8, height: 8)
|
|
|
.padding(.leading, 8)
|
|
.padding(.leading, 8)
|
|
@@ -406,9 +415,9 @@ extension Home {
|
|
|
)
|
|
)
|
|
|
.font(.system(size: 12, weight: .bold)).foregroundColor(.secondary)
|
|
.font(.system(size: 12, weight: .bold)).foregroundColor(.secondary)
|
|
|
}
|
|
}
|
|
|
|
|
+ Spacer()
|
|
|
}
|
|
}
|
|
|
.frame(maxWidth: .infinity)
|
|
.frame(maxWidth: .infinity)
|
|
|
- .padding([.bottom], 20)
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -424,9 +433,28 @@ extension Home {
|
|
|
try? moc.save()
|
|
try? moc.save()
|
|
|
state.hours = button.hours
|
|
state.hours = button.hours
|
|
|
}
|
|
}
|
|
|
- .foregroundStyle(button.active ? .primary : .secondary)
|
|
|
|
|
|
|
+ .foregroundStyle(button.active ? (colorScheme == .dark ? Color.white : Color.black).opacity(0.9) : .secondary)
|
|
|
.frame(maxHeight: 30).padding(.horizontal, 8)
|
|
.frame(maxHeight: 30).padding(.horizontal, 8)
|
|
|
- .background(button.active ? Color(.systemGray5) : .clear, in: .capsule(style: .circular))
|
|
|
|
|
|
|
+ .background(
|
|
|
|
|
+ button.active ?
|
|
|
|
|
+ // RGB(30, 60, 95)
|
|
|
|
|
+ (
|
|
|
|
|
+ colorScheme == .dark ? Color(red: 0.1176470588, green: 0.2352941176, blue: 0.3725490196) :
|
|
|
|
|
+ Color.white
|
|
|
|
|
+ ) :
|
|
|
|
|
+ Color
|
|
|
|
|
+ .clear
|
|
|
|
|
+ )
|
|
|
|
|
+ .shadow(
|
|
|
|
|
+ color: colorScheme == .dark ? Color(
|
|
|
|
|
+ red: 0.02745098039,
|
|
|
|
|
+ green: 0.1098039216,
|
|
|
|
|
+ blue: 0.1411764706
|
|
|
|
|
+ ) : Color
|
|
|
|
|
+ .black.opacity(0.33),
|
|
|
|
|
+ radius: 3
|
|
|
|
|
+ )
|
|
|
|
|
+ .cornerRadius(20)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.font(buttonFont)
|
|
.font(buttonFont)
|
|
@@ -660,15 +688,15 @@ extension Home {
|
|
|
VStack(spacing: 0) {
|
|
VStack(spacing: 0) {
|
|
|
Spacer()
|
|
Spacer()
|
|
|
|
|
|
|
|
- ZStack {
|
|
|
|
|
- glucoseView
|
|
|
|
|
|
|
+// ZStack {
|
|
|
|
|
+ glucoseView.padding(.top, 75)
|
|
|
|
|
|
|
|
- loopView
|
|
|
|
|
- /// circles width is 110, loops width is 35 -> (110/2) - (35/2) = 55 - 17.5 = 37.5
|
|
|
|
|
- .offset(x: UIScreen.main.bounds.width * 0.43, y: -37.5)
|
|
|
|
|
- .padding(.trailing, 10)
|
|
|
|
|
- }
|
|
|
|
|
- .padding(.top, 75)
|
|
|
|
|
|
|
+// loopView
|
|
|
|
|
+// /// circles width is 110, loops width is 35 -> (110/2) - (35/2) = 55 - 17.5 = 37.5
|
|
|
|
|
+// .offset(x: UIScreen.main.bounds.width * 0.43, y: -37.5)
|
|
|
|
|
+// .padding(.trailing, 10)
|
|
|
|
|
+// }
|
|
|
|
|
+// .padding(.top, 75)
|
|
|
|
|
|
|
|
Spacer()
|
|
Spacer()
|
|
|
|
|
|
|
@@ -697,8 +725,6 @@ extension Home {
|
|
|
|
|
|
|
|
timeInterval
|
|
timeInterval
|
|
|
|
|
|
|
|
- Spacer()
|
|
|
|
|
-
|
|
|
|
|
legendPanel
|
|
legendPanel
|
|
|
|
|
|
|
|
Spacer()
|
|
Spacer()
|