Skip to content

Commit

Permalink
Merge pull request #228
Browse files Browse the repository at this point in the history
Implement update for changing the tag labels color in the UI
  • Loading branch information
KrashKart authored Nov 5, 2024
2 parents 46e0f7a + de139bc commit 49ca26f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/tag/TagCategory.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Provides categories to sort Tags into, as well as colour codes for display in the UI.
*/
public enum TagCategory {
GENERAL("#ECECEC"), // Light Grey for default color
GENERAL("#A9A9A9"), // Dark Grey for default color
ACADEMICS("#FFD700"), // Gold
ACTIVITIES("#1E90FF"), // Dodger Blue
NETWORKING("#32CD32"), // Lime Green
Expand Down
12 changes: 9 additions & 3 deletions src/main/java/seedu/address/ui/PersonCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,18 @@ public PersonCard(Person person, int displayedIndex) {
name.setText(person.getName().fullName);
phone.setText(person.getPhone().value);
email.setText(person.getEmail().value);
person.getOrderedTags()
.forEach(tag -> tags.getChildren().add(new Label(tag.tagName + " " + tag.getTagCategory())));

syncPersonTagDetails(person);

// add horizontal and vertical gaps for the tags FlowPane
tags.setHgap(5);
tags.setVgap(5);
}

private void syncPersonTagDetails(Person person) {
person.getOrderedTags().forEach(tag -> {
Label tagLabel = new Label(tag.tagName);
tagLabel.setStyle("-fx-padding: 2; -fx-background-color: " + tag.getTagColour());
tags.getChildren().add(tagLabel);
});
}
}

0 comments on commit 49ca26f

Please sign in to comment.