From d0fd083fffdc1812c15a7a9386af5fe159d43a9b Mon Sep 17 00:00:00 2001 From: HSoreide <sofie.scisly@gmail.com> Date: Sat, 22 Apr 2023 17:00:32 +0200 Subject: [PATCH] Resolve conflicts after rebasing onto master --- .../controller/AddIngredientController.java | 32 ++++++++++++++++--- .../controller/IngredientTileController.java | 2 +- .../resources/budgets/SelectedBudget.current | 2 +- src/main/resources/recipes/Fridge.register | 4 +++ src/main/resources/style.css | 2 +- src/main/resources/view/Recipe.fxml | 22 ++++++++----- 6 files changed, 49 insertions(+), 15 deletions(-) diff --git a/src/main/java/no/ntnu/idatt1002/demo/controller/AddIngredientController.java b/src/main/java/no/ntnu/idatt1002/demo/controller/AddIngredientController.java index fa34cebe..a5c67bb4 100644 --- a/src/main/java/no/ntnu/idatt1002/demo/controller/AddIngredientController.java +++ b/src/main/java/no/ntnu/idatt1002/demo/controller/AddIngredientController.java @@ -5,21 +5,20 @@ import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.fxml.FXML; import javafx.fxml.Initializable; -import javafx.scene.control.Label; -import javafx.scene.control.ListView; +import javafx.scene.control.*; + import java.io.IOException; import java.net.URL; import java.util.Arrays; import java.util.List; import java.util.ResourceBundle; import java.util.stream.Collectors; -import javafx.scene.control.Button; -import javafx.scene.control.TextField; import no.ntnu.idatt1002.demo.data.recipes.FileHandler; import no.ntnu.idatt1002.demo.data.recipes.FoodItem; import no.ntnu.idatt1002.demo.data.recipes.IngredientsAtHand; + /** * The AddIngredientController manages a dialog pane used to display a search-field along with a list of all the * possible food types in the application according to the FoodItem enum class. The food types in the list may be @@ -38,6 +37,10 @@ public class AddIngredientController implements Initializable { @FXML private Button addBtn; + @FXML + private Button helpBtn; + + @FXML private ListView<String> listView; @@ -68,6 +71,27 @@ public class AddIngredientController implements Initializable { status.setWrapText(true); } + + /** + * The help method is called whenever the help-button (displayed as a round button with a question mark on it) is + * clicked. An alert box appears on the screen with information about how the current window is navigated to + * perform the intended use. + */ + @FXML + void help () { + Alert a = new Alert(Alert.AlertType.INFORMATION); + a.setTitle("How to add ingredients to the fridge"); + String information = "Write a word in the search field and either press 'ENTER' on your keyboard or " + + "press the button 'Search' to perform the search. Then click on the food you want to add and " + + "press the 'ADD' button. If the food was added to the fridge, it will appear below the 'ADD' button, " + + "if not, it was probably in the fridge already!"; + + a.setContentText(information); + a.showAndWait(); + } + + + /** * The addToFridge method reads an up-to-date instance of the IngredientsAtHand object from file and * gets hold of the FoodItem constant that is currently selected in the list. If the selected FoodItem is not diff --git a/src/main/java/no/ntnu/idatt1002/demo/controller/IngredientTileController.java b/src/main/java/no/ntnu/idatt1002/demo/controller/IngredientTileController.java index d7cb7ac7..3762ad3c 100644 --- a/src/main/java/no/ntnu/idatt1002/demo/controller/IngredientTileController.java +++ b/src/main/java/no/ntnu/idatt1002/demo/controller/IngredientTileController.java @@ -31,6 +31,6 @@ public class IngredientTileController { .append(ingredient.getAmount()).append(" ") .append(ingredient.getUnit().label); text.setText(String.valueOf(sb)); - text.setStyle("-fx-font-size: 18"); + text.setStyle("-fx-font-size: 16"); } } diff --git a/src/main/resources/budgets/SelectedBudget.current b/src/main/resources/budgets/SelectedBudget.current index 0e696bb6..06b27909 100644 --- a/src/main/resources/budgets/SelectedBudget.current +++ b/src/main/resources/budgets/SelectedBudget.current @@ -1 +1 @@ -APRILpåske \ No newline at end of file +APRILreasonable \ No newline at end of file diff --git a/src/main/resources/recipes/Fridge.register b/src/main/resources/recipes/Fridge.register index a2241d99..d4bad4f3 100644 --- a/src/main/resources/recipes/Fridge.register +++ b/src/main/resources/recipes/Fridge.register @@ -17,3 +17,7 @@ LAM CHILLI_POWDER SAUSAGE YELLOW_CHEESE +PARMESAN +OLIVE_OIL +CHILLI +EGG diff --git a/src/main/resources/style.css b/src/main/resources/style.css index 57dceb0f..0a8075b8 100644 --- a/src/main/resources/style.css +++ b/src/main/resources/style.css @@ -128,7 +128,7 @@ } .scroll-pane { - -fx-background-color: rgba(255, 255, 255, 0.35); + -fx-background-color: rgba(255, 255, 255, 0.5); -fx-border-width: 5; -fx-border-radius: 5; -fx-border-color: rgba(255, 255, 255, 0.75); diff --git a/src/main/resources/view/Recipe.fxml b/src/main/resources/view/Recipe.fxml index b96a1597..5e71c20a 100644 --- a/src/main/resources/view/Recipe.fxml +++ b/src/main/resources/view/Recipe.fxml @@ -11,7 +11,10 @@ <ImageView fitHeight="695.0" fitWidth="1130.0" pickOnBounds="true" preserveRatio="true"> <image> <Image url="@../Images/backgroundMini.jpg" /> - </image></ImageView> + </image> + <rotationAxis> + <Point3D /> + </rotationAxis></ImageView> <BorderPane prefHeight="695.0" prefWidth="1130.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <top> <HBox prefHeight="164.0" prefWidth="1130.0" BorderPane.alignment="CENTER"> @@ -27,12 +30,15 @@ </Pane> <Pane prefHeight="103.0" prefWidth="853.0"> <children> - <Label fx:id="recipeName" alignment="CENTER" contentDisplay="CENTER" layoutX="44.0" layoutY="38.0" styleClass="head-line" stylesheets="@../style.css" text="RecipeName" textAlignment="CENTER"> + <Label fx:id="recipeName" alignment="CENTER" contentDisplay="CENTER" layoutY="3.0" prefHeight="156.0" prefWidth="735.0" styleClass="head-line" stylesheets="@../style.css" text="RecipeName" textAlignment="CENTER" wrapText="true"> <font> <Font size="36.0" /> </font> </Label> </children> + <HBox.margin> + <Insets right="25.0" /> + </HBox.margin> </Pane> </children> </HBox> @@ -40,9 +46,9 @@ <center> <HBox prefHeight="100.0" prefWidth="200.0" spacing="50.0" BorderPane.alignment="CENTER"> <children> - <ScrollPane prefHeight="431.0" prefWidth="263.0" stylesheets="@../style.css"> + <ScrollPane prefHeight="454.0" prefWidth="311.0" stylesheets="@../style.css"> <content> - <AnchorPane prefHeight="449.0" prefWidth="270.0" styleClass="ingredient-pane" stylesheets="@../style.css"> + <AnchorPane styleClass="ingredient-pane" stylesheets="@../style.css"> <children> <VBox fx:id="ingredientList" styleClass="ingredient-list" stylesheets="@../style.css"> <padding> @@ -52,7 +58,7 @@ </AnchorPane> </content> </ScrollPane> - <ScrollPane prefHeight="429.0" prefWidth="632.0" stylesheets="@../style.css"> + <ScrollPane prefHeight="454.0" prefWidth="660.0" stylesheets="@../style.css"> <content> <Pane id="recipe-instructions" stylesheets="@../style.css"> <children> @@ -68,13 +74,13 @@ </HBox> </center> <left> - <Pane prefHeight="457.0" prefWidth="75.0" BorderPane.alignment="CENTER" /> + <Pane prefHeight="454.0" prefWidth="45.0" BorderPane.alignment="CENTER" /> </left> <bottom> - <Pane prefHeight="77.0" prefWidth="1130.0" BorderPane.alignment="CENTER" /> + <Pane prefHeight="56.0" prefWidth="1130.0" BorderPane.alignment="CENTER" /> </bottom> <right> - <Pane prefHeight="454.0" prefWidth="122.0" BorderPane.alignment="CENTER" /> + <Pane prefHeight="454.0" prefWidth="86.0" BorderPane.alignment="CENTER" /> </right></BorderPane> </children> </AnchorPane> -- GitLab