Skip to content

Commit

Permalink
Slight change to UI
Browse files Browse the repository at this point in the history
  • Loading branch information
CFSY committed Oct 22, 2022
1 parent 0d706af commit 31125c3
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/main/java/seedu/waddle/ui/ItemGroupCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public class ItemGroupCard extends UiPart<Region> {
@FXML
private StackPane itemListPanelPlaceholder;


/**
* Creates a {@code ItineraryCode} with the given {@code Itinerary} and index to display.
*/
Expand All @@ -41,8 +40,8 @@ public ItemGroupCard(ObservableList<Item> itemGroup, int displayedIndex) {
} else {
this.id.setText("Day " + displayedIndex);
}
System.out.println("SET ITEM GROUP ID");
this.itemListPanelPlaceholder.getChildren().add(new ItemListPanel(itemGroup).getRoot());
this.itemListPanelPlaceholder.setMinHeight(UiSizes.ITEM_LIST_MIN_HEIGHT);
}

@Override
Expand Down
1 change: 0 additions & 1 deletion src/main/java/seedu/waddle/ui/ItemGroupListPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public ItemGroupListPanel(ObservableList<ObservableList<Item>> itemGroups) {
super(FXML);
itemGroupListView.setItems(itemGroups);
itemGroupListView.setCellFactory(listView -> new ItemGroupListPanel.ItemGroupListViewCell());
System.out.println("DONE CREATING GROUP LIST PANEL");
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/seedu/waddle/ui/ItemListPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.logging.Logger;

import javafx.beans.binding.Bindings;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.ListCell;
Expand All @@ -26,6 +27,7 @@ public ItemListPanel(ObservableList<Item> itemList) {
super(FXML);
itemListView.setItems(itemList);
itemListView.setCellFactory(listView -> new ItemListPanel.ItemListViewCell());
itemListView.prefHeightProperty().bind(Bindings.size(itemList).multiply(UiSizes.ITEM_CARD_HEIGHT));
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/main/java/seedu/waddle/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ private CommandResult executeCommand(String commandText) throws CommandException
case WISH:
ObservableList<ObservableList<Item>> itemGroups = StageManager.getInstance()
.getSelectedItinerary().getUnmodifiableItemGroups();
System.out.println("GOT UNMODIFIABLE ITEM GROUPS");
setListPanel(new ItemGroupListPanel(itemGroups));
break;
case SCHEDULE:
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/seedu/waddle/ui/UiSizes.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package seedu.waddle.ui;

public class UiSizes {
public static final double ITEM_CARD_HEIGHT = 120;
public static final double ITEM_LIST_MIN_HEIGHT = 20;
}
2 changes: 1 addition & 1 deletion src/main/resources/view/ItemGroupListCard.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<VBox VBox.vgrow="ALWAYS" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Label fx:id="id" prefHeight="60.0" text="Label" />
<StackPane fx:id="itemListPanelPlaceholder" prefHeight="100" VBox.vgrow="ALWAYS" />
<StackPane fx:id="itemListPanelPlaceholder"/>
</children>
</VBox>
2 changes: 1 addition & 1 deletion src/main/resources/view/ItemListCard.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10" prefWidth="150" />
</columnConstraints>
<VBox alignment="CENTER_LEFT" minHeight="105" GridPane.columnIndex="0">
<VBox alignment="CENTER_LEFT" minHeight="120" GridPane.columnIndex="0">
<padding>
<Insets top="5" right="5" bottom="5" left="15" />
</padding>
Expand Down

0 comments on commit 31125c3

Please sign in to comment.