Skip to content
Snippets Groups Projects
Commit 403bc1fc authored by Blersch Lara's avatar Blersch Lara
Browse files

unified how ingredients are displayed

parent 9e08c410
No related branches found
No related tags found
No related merge requests found
package mi.hdm.components; package mi.hdm.components;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox; import javafx.scene.layout.HBox;
import javafx.scene.text.Text; import javafx.scene.text.Text;
import mi.hdm.recipes.RecipeComponent; import mi.hdm.recipes.RecipeComponent;
...@@ -13,7 +14,7 @@ public class IngredientLabel extends HBox { ...@@ -13,7 +14,7 @@ public class IngredientLabel extends HBox {
this.amount = amount; this.amount = amount;
this.component = component; this.component = component;
Text labelAmount = new Text(amount + " " + component.getMeasurement()); Text labelAmount = new Text(amount + " " + component.getMeasurement().getAbbreviation());
Text labelName = new Text(component.getName()); Text labelName = new Text(component.getName());
getChildren().addAll(labelAmount, labelName); getChildren().addAll(labelAmount, labelName);
......
...@@ -35,9 +35,10 @@ public class SelectedIngredientLabel extends HBox { ...@@ -35,9 +35,10 @@ public class SelectedIngredientLabel extends HBox {
amountTextField = new TextField(amount.toString()); amountTextField = new TextField(amount.toString());
amountTextField.setOnAction(e -> validateAmountInput()); amountTextField.setOnAction(e -> validateAmountInput());
amountTextField.setPrefWidth(75.0); amountTextField.setPrefWidth(75.0);
Label componentNameLabel = new Label(component.getName()); Label measurement = new Label(component.getMeasurement().getAbbreviation());
Label componentNameLabel = new Label("| " + component.getName());
getChildren().addAll(amountTextField, componentNameLabel); getChildren().addAll(amountTextField, measurement, componentNameLabel);
setAlignment(Pos.BASELINE_LEFT); setAlignment(Pos.BASELINE_LEFT);
setSpacing(5.0); setSpacing(5.0);
......
...@@ -78,6 +78,7 @@ public class RecipeViewController extends BaseController { ...@@ -78,6 +78,7 @@ public class RecipeViewController extends BaseController {
recipeImage.setImage(image); recipeImage.setImage(image);
recipeImage.setPreserveRatio(true); recipeImage.setPreserveRatio(true);
//TODO: for some images (f.ex. Tasty_Pages_Arrow_back.png) the image is larger than the image view //TODO: for some images (f.ex. Tasty_Pages_Arrow_back.png) the image is larger than the image view
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment