style(client): align ingredient and step list widths

- Remove AnchorPane wrappers from IngredientList and RecipeStepList
- Set maxWidth to Infinity on root VBox elements
- Set maxWidth to Infinity on ListView components
- Both lists now have consistent widths and fill container space

Fixes #48
This commit is contained in:
Rithvik Sriram 2026-01-09 16:33:01 +01:00
commit a7d9fcb37b
3 changed files with 47 additions and 48 deletions

View file

@ -9,33 +9,32 @@
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<AnchorPane xmlns="http://javafx.com/javafx/25" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client.scenes.recipe.IngredientListCtrl">
<VBox xmlns="http://javafx.com/javafx/25" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="client.scenes.recipe.IngredientListCtrl"
minHeight="200.0" minWidth="200.0" maxWidth="Infinity">
<children>
<VBox minHeight="200.0" minWidth="200.0">
<HBox alignment="CENTER_LEFT" spacing="20.0">
<children>
<HBox alignment="CENTER_LEFT" spacing="20.0">
<children>
<Label fx:id="ingredientsLabel" text="Ingredients">
<padding>
<Insets bottom="5.0" top="5.0" />
</padding>
<font>
<Font name="System Bold" size="16.0" />
</font>
</Label>
<HBox alignment="CENTER" spacing="10.0">
<children>
<Button fx:id="addIngredientButton" mnemonicParsing="false" text="Add" />
<Button fx:id="deleteIngredientButton" mnemonicParsing="false" text="Delete" />
</children>
</HBox>
</children>
<Label fx:id="ingredientsLabel" text="Ingredients">
<padding>
<Insets left="10.0" right="10.0" />
<Insets bottom="5.0" top="5.0" />
</padding>
<font>
<Font name="System Bold" size="16.0" />
</font>
</Label>
<HBox alignment="CENTER" spacing="10.0">
<children>
<Button fx:id="addIngredientButton" mnemonicParsing="false" text="Add" />
<Button fx:id="deleteIngredientButton" mnemonicParsing="false" text="Delete" />
</children>
</HBox>
<ListView fx:id="ingredientListView" prefHeight="200.0" prefWidth="200.0" />
</children>
</VBox>
<padding>
<Insets left="10.0" right="10.0" />
</padding>
</HBox>
<ListView fx:id="ingredientListView" prefHeight="200.0" prefWidth="200.0" />
</children>
</AnchorPane>
</VBox>

View file

@ -28,8 +28,10 @@
</HBox>
<!-- Ingredients -->
<fx:include source="IngredientList.fxml" fx:id="ingredientList" />
<fx:include source="IngredientList.fxml" fx:id="ingredientList"
VBox.vgrow="ALWAYS" maxWidth="Infinity" />
<!-- Preparation -->
<fx:include source="RecipeStepList.fxml" fx:id="stepList" />
<fx:include source="RecipeStepList.fxml" fx:id="stepList"
VBox.vgrow="ALWAYS" maxWidth="Infinity" />
</VBox>

View file

@ -9,33 +9,31 @@
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<AnchorPane xmlns="http://javafx.com/javafx/25" xmlns:fx="http://javafx.com/fxml/1" fx:controller="client.scenes.recipe.RecipeStepListCtrl">
<VBox xmlns="http://javafx.com/javafx/25" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="client.scenes.recipe.RecipeStepListCtrl"
minHeight="200.0" minWidth="200.0" maxWidth="Infinity">
<children>
<VBox minHeight="200.0" minWidth="200.0">
<HBox alignment="CENTER_LEFT" spacing="20.0">
<children>
<HBox alignment="CENTER_LEFT" spacing="20.0">
<children>
<Label fx:id="stepsLabel" text="Steps">
<padding>
<Insets bottom="5.0" top="5.0" />
</padding>
<font>
<Font name="System Bold" size="16.0" />
</font>
</Label>
<HBox alignment="CENTER" spacing="10.0">
<children>
<Button fx:id="addStepButton" mnemonicParsing="false" text="Add" />
<Button fx:id="deleteStepButton" mnemonicParsing="false" text="Delete" />
</children>
</HBox>
</children>
<Label fx:id="stepsLabel" text="Steps">
<padding>
<Insets left="10.0" right="10.0" />
<Insets bottom="5.0" top="5.0" />
</padding>
<font>
<Font name="System Bold" size="16.0" />
</font>
</Label>
<HBox alignment="CENTER" spacing="10.0">
<children>
<Button fx:id="addStepButton" mnemonicParsing="false" text="Add" />
<Button fx:id="deleteStepButton" mnemonicParsing="false" text="Delete" />
</children>
</HBox>
<ListView fx:id="recipeStepListView" prefHeight="200.0" prefWidth="200.0" />
</children>
</VBox>
<padding>
<Insets left="10.0" right="10.0" />
</padding>
</HBox>
<ListView fx:id="recipeStepListView" prefHeight="200.0" prefWidth="200.0" />
</children>
</AnchorPane>
</VBox>