|
@@ -5,7 +5,6 @@ struct CarbsView: View {
|
|
|
|
|
|
|
|
// Selected nutrient
|
|
// Selected nutrient
|
|
|
enum Selection: String {
|
|
enum Selection: String {
|
|
|
- case none
|
|
|
|
|
case carbs
|
|
case carbs
|
|
|
case protein
|
|
case protein
|
|
|
case fat
|
|
case fat
|
|
@@ -63,9 +62,15 @@ struct CarbsView: View {
|
|
|
WKInterfaceDevice.current().play(.click)
|
|
WKInterfaceDevice.current().play(.click)
|
|
|
let newValue = carbAmount - 5
|
|
let newValue = carbAmount - 5
|
|
|
carbAmount = max(newValue, 0)
|
|
carbAmount = max(newValue, 0)
|
|
|
- } label: { Image(systemName: "minus") }
|
|
|
|
|
- .buttonStyle(.borderless).padding(.leading, 5)
|
|
|
|
|
- .tint(selection == .carbs ? .blue : .none)
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ label: {
|
|
|
|
|
+ HStack {
|
|
|
|
|
+ Image(systemName: "minus")
|
|
|
|
|
+ Text("") // Ugly fix to increase active tapping (button) area.
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .buttonStyle(.borderless).padding(.leading, 5)
|
|
|
|
|
+ .tint(selection == .carbs ? .blue : .none)
|
|
|
}
|
|
}
|
|
|
Spacer()
|
|
Spacer()
|
|
|
Text("🥨")
|
|
Text("🥨")
|
|
@@ -93,6 +98,7 @@ struct CarbsView: View {
|
|
|
.tint(selection == .carbs ? .blue : .none)
|
|
.tint(selection == .carbs ? .blue : .none)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ .minimumScaleFactor(0.7)
|
|
|
.onTapGesture {
|
|
.onTapGesture {
|
|
|
select(entry: .carbs)
|
|
select(entry: .carbs)
|
|
|
}
|
|
}
|
|
@@ -107,9 +113,14 @@ struct CarbsView: View {
|
|
|
WKInterfaceDevice.current().play(.click)
|
|
WKInterfaceDevice.current().play(.click)
|
|
|
let newValue = proteinAmount - 5
|
|
let newValue = proteinAmount - 5
|
|
|
proteinAmount = max(newValue, 0)
|
|
proteinAmount = max(newValue, 0)
|
|
|
- } label: { Image(systemName: "minus") }
|
|
|
|
|
- .buttonStyle(.borderless).padding(.leading, 5)
|
|
|
|
|
- .tint(selection == .protein ? .blue : .none)
|
|
|
|
|
|
|
+ } label: {
|
|
|
|
|
+ HStack {
|
|
|
|
|
+ Image(systemName: "minus")
|
|
|
|
|
+ Text("") // Ugly fix to increase active tapping (button) area.
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .buttonStyle(.borderless).padding(.leading, 5)
|
|
|
|
|
+ .tint(selection == .protein ? .blue : .none)
|
|
|
}
|
|
}
|
|
|
Spacer()
|
|
Spacer()
|
|
|
Text("🍗")
|
|
Text("🍗")
|
|
@@ -137,6 +148,7 @@ struct CarbsView: View {
|
|
|
.tint(selection == .protein ? .blue : .none)
|
|
.tint(selection == .protein ? .blue : .none)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ .minimumScaleFactor(0.7)
|
|
|
.onTapGesture {
|
|
.onTapGesture {
|
|
|
select(entry: .protein)
|
|
select(entry: .protein)
|
|
|
}
|
|
}
|
|
@@ -150,9 +162,14 @@ struct CarbsView: View {
|
|
|
WKInterfaceDevice.current().play(.click)
|
|
WKInterfaceDevice.current().play(.click)
|
|
|
let newValue = fatAmount - 5
|
|
let newValue = fatAmount - 5
|
|
|
fatAmount = max(newValue, 0)
|
|
fatAmount = max(newValue, 0)
|
|
|
- } label: { Image(systemName: "minus") }
|
|
|
|
|
- .buttonStyle(.borderless).padding(.leading, 5)
|
|
|
|
|
- .tint(selection == .fat ? .blue : .none)
|
|
|
|
|
|
|
+ } label: {
|
|
|
|
|
+ HStack {
|
|
|
|
|
+ Image(systemName: "minus")
|
|
|
|
|
+ Text("") // Ugly fix to increase active tapping (button) area.
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .buttonStyle(.borderless).padding(.leading, 5)
|
|
|
|
|
+ .tint(selection == .fat ? .blue : .none)
|
|
|
}
|
|
}
|
|
|
Spacer()
|
|
Spacer()
|
|
|
Text("🧀")
|
|
Text("🧀")
|
|
@@ -181,6 +198,7 @@ struct CarbsView: View {
|
|
|
.tint(selection == .fat ? .blue : .none)
|
|
.tint(selection == .fat ? .blue : .none)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ .minimumScaleFactor(0.7)
|
|
|
.onTapGesture {
|
|
.onTapGesture {
|
|
|
select(entry: .fat)
|
|
select(entry: .fat)
|
|
|
}
|
|
}
|