Skip to content

Commit

Permalink
Update Ui
Browse files Browse the repository at this point in the history
  • Loading branch information
flyingsalsa committed Oct 12, 2024
1 parent fe8ca7c commit 4c91936
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/java/seedu/address/logic/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public static String format(Person person) {
.append(person.getAddress())
.append("; Tags: ");
person.getTags().forEach(builder::append);
builder.append("; Games: ");
person.getGames().forEach(builder::append);
return builder.toString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class AddCommandParser implements Parser<AddCommand> {
*/
public AddCommand parse(String args) throws ParseException {
ArgumentMultimap argMultimap =
ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS, PREFIX_TAG);
ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS, PREFIX_TAG, PREFIX_GAME);

if (!arePrefixesPresent(argMultimap, PREFIX_NAME, PREFIX_ADDRESS, PREFIX_PHONE, PREFIX_EMAIL)
|| !argMultimap.getPreamble().isEmpty()) {
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/seedu/address/ui/PersonCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public class PersonCard extends UiPart<Region> {
private Label email;
@FXML
private FlowPane tags;
@FXML
private FlowPane games;


/**
* Creates a {@code PersonCode} with the given {@code Person} and index to display.
Expand All @@ -55,5 +58,8 @@ public PersonCard(Person person, int displayedIndex) {
person.getTags().stream()
.sorted(Comparator.comparing(tag -> tag.tagName))
.forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));
person.getGames().stream()
.sorted(Comparator.comparing(game -> game.gameName))
.forEach(game -> games.getChildren().add(new Label(game.gameName)));
}
}
Binary file modified src/main/resources/images/address_book_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/resources/images/address_book_32old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions src/main/resources/view/DarkTheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,16 @@
-fx-background-radius: 2;
-fx-font-size: 11;
}
#games {
-fx-hgap: 7;
-fx-vgap: 3;
}

#games .label {
-fx-text-fill: white;
-fx-background-color: #3e7b91;
-fx-padding: 1 3 1 3;
-fx-border-radius: 2;
-fx-background-radius: 2;
-fx-font-size: 11;
}
1 change: 1 addition & 0 deletions src/main/resources/view/PersonListCard.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<Label fx:id="phone" styleClass="cell_small_label" text="\$phone" />
<Label fx:id="address" styleClass="cell_small_label" text="\$address" />
<Label fx:id="email" styleClass="cell_small_label" text="\$email" />
<FlowPane fx:id="games" />
</VBox>
</GridPane>
</HBox>

0 comments on commit 4c91936

Please sign in to comment.