|
|
@@ -129,7 +129,7 @@ extension AddCarbs {
|
|
|
if state.fat != 0 { state.fat -= ((state.selection?.fat ?? 0) as NSDecimalNumber) as Decimal }
|
|
|
if state.protein != 0 { state.protein -= ((state.selection?.protein ?? 0) as NSDecimalNumber) as Decimal }
|
|
|
}
|
|
|
- label: { Text("- 1") }
|
|
|
+ label: { Text("[ -1 ]") }
|
|
|
.disabled(state.selection == nil || (
|
|
|
(((state.selection?.carbs ?? 0) as NSDecimalNumber) as Decimal) == state
|
|
|
.carbs && (((state.selection?.fat ?? 0) as NSDecimalNumber) as Decimal) == state
|
|
|
@@ -138,16 +138,14 @@ extension AddCarbs {
|
|
|
))
|
|
|
.buttonStyle(BorderlessButtonStyle())
|
|
|
.frame(maxWidth: .infinity, alignment: .trailing)
|
|
|
- .accentColor(.red)
|
|
|
+ .accentColor(.orange)
|
|
|
Button {
|
|
|
state.carbs += ((state.selection?.carbs ?? 0) as NSDecimalNumber) as Decimal
|
|
|
state.fat += ((state.selection?.fat ?? 0) as NSDecimalNumber) as Decimal
|
|
|
state.protein += ((state.selection?.protein ?? 0) as NSDecimalNumber) as Decimal }
|
|
|
- label: { Text("+ 1") }
|
|
|
+ label: { Text("[ +1 ]") }
|
|
|
.disabled(state.selection == nil)
|
|
|
.buttonStyle(BorderlessButtonStyle())
|
|
|
- .frame(maxWidth: .infinity, alignment: .trailing)
|
|
|
- .accentColor(.green)
|
|
|
}
|
|
|
}
|
|
|
}
|