feat(client/nutrition): updated nutrition UI modelling

Uses "idiomatic JavaFX" to model automatic update propagation by object
view models.
This commit is contained in:
Zhongheng Liu 2026-01-15 17:09:39 +01:00
commit 1bfc103ecc
Signed by: steven
GPG key ID: F69B980899C1C09D
5 changed files with 173 additions and 19 deletions

View file

@ -13,18 +13,15 @@
fx:id="nutritionDetails"
visible="false">
<Label fx:id="ingredientName" />
<HBox>
<Label fx:id="fatInputLabel">Fat: </Label>
<TextField fx:id="fatInputElement" />
</HBox>
<HBox>
<Label fx:id="proteinInputLabel">Protein: </Label>
<TextField fx:id="proteinInputElement" />
</HBox>
<HBox>
<Label fx:id="carbInputLabel">Carbohydrates: </Label>
<TextField fx:id="carbInputElement" />
</HBox>
<GridPane fx:id="nutritionValueContainer">
<Label GridPane.columnIndex="0" GridPane.rowIndex="0" fx:id="fatInputLabel">Fat: </Label>
<TextField GridPane.columnIndex="1" GridPane.rowIndex="0" fx:id="fatInputElement" />
<Label GridPane.columnIndex="0" GridPane.rowIndex="1" fx:id="proteinInputLabel">Protein: </Label>
<TextField GridPane.columnIndex="1" GridPane.rowIndex="1" fx:id="proteinInputElement" />
<Label GridPane.columnIndex="0" GridPane.rowIndex="2" fx:id="carbInputLabel">Carbohydrates: </Label>
<TextField GridPane.columnIndex="1" GridPane.rowIndex="2" fx:id="carbInputElement" />
</GridPane>
<Button onAction="#handleNutritionSaveClick">Save values</Button>
<Label fx:id="estimatedKcalLabel">Estimated: 0kcal</Label>
<Label fx:id="usageLabel">Not used in any recipes</Label>
</VBox>