feat(client/fxml): add relevant components

This commit is contained in:
Zhongheng Liu 2026-01-22 18:46:52 +01:00
commit 483617c5bf
Signed by: steven
GPG key ID: F69B980899C1C09D
2 changed files with 17 additions and 8 deletions

View file

@ -25,6 +25,7 @@
<Button fx:id="removeRecipeButton" mnemonicParsing="false" onAction="#removeSelectedRecipe" text="Remove Recipe" /> <Button fx:id="removeRecipeButton" mnemonicParsing="false" onAction="#removeSelectedRecipe" text="Remove Recipe" />
<Button fx:id="printRecipeButton" mnemonicParsing="false" onAction="#printRecipe" text="Print Recipe" /> <Button fx:id="printRecipeButton" mnemonicParsing="false" onAction="#printRecipe" text="Print Recipe" />
<Button fx:id="favouriteButton" onAction="#toggleFavourite" text="☆" /> <Button fx:id="favouriteButton" onAction="#toggleFavourite" text="☆" />
<Button onAction="#handleAddAllToShoppingList">Shop</Button>
</HBox> </HBox>
<HBox> <HBox>

View file

@ -4,12 +4,20 @@
<?import javafx.scene.control.TitledPane?> <?import javafx.scene.control.TitledPane?>
<?import javafx.scene.layout.AnchorPane?> <?import javafx.scene.layout.AnchorPane?>
<TitledPane animated="false" collapsible="false" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" text="Shopping List" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/25"> <?import javafx.scene.layout.HBox?>
<content> <?import javafx.scene.control.Button?>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0"> <?import javafx.scene.layout.VBox?>
<children> <TitledPane animated="false" collapsible="false" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity"
<ListView fx:id="shoppingListView" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" /> minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" text="Shopping List"
</children> fx:controller="client.scenes.shopping.ShoppingListCtrl"
</AnchorPane> xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/25">
</content> <VBox>
<ListView fx:id="shoppingListView" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
AnchorPane.topAnchor="0.0"/>
<HBox>
<Button onAction="#handleAddItem">Add</Button>
<Button onAction="#handleRemoveItem">Delete</Button>
</HBox>
</VBox>
</TitledPane> </TitledPane>