Skip to content

Commit

Permalink
Merge pull request #79 from dabzpengu/add-user-resume
Browse files Browse the repository at this point in the history
enhance UI
  • Loading branch information
dabzpengu authored Apr 3, 2024
2 parents af1770b + e8e61eb commit 8d9db3b
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 66 deletions.
19 changes: 18 additions & 1 deletion src/main/java/seedu/address/ui/PersonCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public class PersonCard extends UiPart<Region> {
private FlowPane tags;
@FXML
private FlowPane programmingLanguages;

/**
* Creates a {@code PersonCode} with the given {@code Person} and index to display.
*/
Expand All @@ -76,5 +75,23 @@ public PersonCard(Person person, int displayedIndex) {
.sorted(Comparator.comparing(pl -> pl.languageName))
.forEach(pl -> programmingLanguages.getChildren().add(
new Label("Programming Languages: " + pl.languageName)));
updateCardColor(person);
}
private void updateCardColor(Person person) {
String styleClass;
switch (person.getPriority()) {
case 0:
styleClass = "priorityHigh";
break;
case 1:
styleClass = "priorityMedium";
break;
case 2:
styleClass = "priorityLow";
break;
default:
styleClass = "priorityDefault";
}
cardPane.getStyleClass().add(styleClass);
}
}
Binary file added src/main/resources/images/resume_bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions src/main/resources/view/CustomTheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,19 @@
-fx-background-radius: 2;
-fx-font-size: 11;
}

#cardPane.priorityHigh {
-fx-background-color: red;
}

#cardPane.priorityMedium {
-fx-background-color: brown;
}

#cardPane.priorityLow {
-fx-background-color: green;
}

#cardPane.priorityDefault {
-fx-background-color: grey;
}
16 changes: 16 additions & 0 deletions src/main/resources/view/DarkTheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,19 @@
-fx-background-radius: 2;
-fx-font-size: 11;
}

.personListCard.priorityHigh {
-fx-background-color: red;
}

.personListCard.priorityMedium {
-fx-background-color: yellow;
}

.personListCard.priorityLow {
-fx-background-color: green;
}

.personListCard.priorityDefault {
-fx-background-color: grey;
}
16 changes: 16 additions & 0 deletions src/main/resources/view/Extensions.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,19 @@
.tooltip-text {
-fx-text-fill: rgb(255, 255, 255);
}

.personListCard.priorityHigh {
-fx-background-color: red;
}

.personListCard.priorityMedium {
-fx-background-color: yellow;
}

.personListCard.priorityLow {
-fx-background-color: green;
}

.personListCard.priorityDefault {
-fx-background-color: grey;
}
63 changes: 0 additions & 63 deletions src/main/resources/view/MainWindow2.fxml

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/resources/view/PersonListCard.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>

<HBox id="cardPane" fx:id="cardPane" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1">
<HBox fx:id="cardPane" styleClass="personListCard" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1">
<GridPane HBox.hgrow="ALWAYS">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10" prefWidth="150" />
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/view/ResumeWindow2.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<children>
<ImageView fitHeight="272.0" fitWidth="343.0" opacity="0.61">
<image>
<Image url="@../../../../../../Users/Admin/Downloads/autumn-2902532_640.jpg" />
<Image url="@../images/resume_bg.jpg" />
</image>
</ImageView>
<HBox prefHeight="264.0" prefWidth="343.0">
Expand Down

0 comments on commit 8d9db3b

Please sign in to comment.