Skip to content

Commit

Permalink
Merge pull request #56 from S-K-Y-Light/add-Course-GUI
Browse files Browse the repository at this point in the history
Add Courses to GUI
  • Loading branch information
notnotmax authored Oct 10, 2024
2 parents 54786ee + 890384e commit 94c661f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
5 changes: 5 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,8 @@ public class PersonCard extends UiPart<Region> {
private Label email;
@FXML
private FlowPane tags;
@FXML
private FlowPane courses;

/**
* Creates a {@code PersonCode} with the given {@code Person} and index to display.
Expand All @@ -55,5 +57,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.getCourses().stream()
.sorted(Comparator.comparing(course -> course.courseCode))
.forEach(course -> courses.getChildren().add(new Label(course.courseCode)));
}
}
14 changes: 14 additions & 0 deletions src/main/resources/view/DarkTheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,17 @@
-fx-background-radius: 2;
-fx-font-size: 11;
}

#courses {
-fx-hgap: 7;
-fx-vgap: 3;
}

#courses .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 @@ -28,6 +28,7 @@
<Label fx:id="name" text="\$first" styleClass="cell_big_label" />
</HBox>
<FlowPane fx:id="tags" />
<FlowPane fx:id="courses" styleClass="cell_big_label" />
<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" />
Expand Down

0 comments on commit 94c661f

Please sign in to comment.