Skip to content

Commit

Permalink
Enhance looks and feel of Ui
Browse files Browse the repository at this point in the history
  • Loading branch information
chonguschonguschongus committed Nov 2, 2023
1 parent 8c330cc commit 5063b9d
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 93 deletions.
10 changes: 7 additions & 3 deletions src/main/java/seedu/address/ui/DoctorCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,12 @@ public DoctorCard(Doctor doctor, int displayedIndex) {
.forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));
doctor.getAppointments().stream()
.sorted(Comparator.comparing(Appointment::getAppointmentTime))
.forEach(appointment -> appointments.getChildren()
.add(new Label("Appointment with Patient: " + appointment.getPatient() + " at "
+ appointment.getAppointmentTime().format(Appointment.FORMATTER))));
.forEach(appointment -> {
Label appointmentLabel = new Label("Appointment with Patient: " + appointment.getPatient() + " at "
+ appointment.getAppointmentTime().format(Appointment.FORMATTER));
appointmentLabel.setWrapText(true); // Enable text wrapping
appointmentLabel.setPrefWidth(250); // Set the maximum width for text wrapping (adjust as needed)
appointments.getChildren().add(appointmentLabel);
});
}
}
11 changes: 7 additions & 4 deletions src/main/java/seedu/address/ui/PatientCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,13 @@ public PatientCard(Patient person, int displayedIndex) {
.forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));
person.getAppointments().stream()
.sorted(Comparator.comparing(Appointment::getAppointmentTime))
.forEach(appointment -> appointments.getChildren()
.add(new Label("Appointment with Doctor: " + appointment.getDoctor() + " at "
+ appointment.getAppointmentTime().format(Appointment.FORMATTER))));

.forEach(appointment -> {
Label appointmentLabel = new Label("Appointment with Doctor: " + appointment.getDoctor() + " at "
+ appointment.getAppointmentTime().format(Appointment.FORMATTER));
appointmentLabel.setWrapText(true); // Enable text wrapping
appointmentLabel.setPrefWidth(250); // Set the maximum width for text wrapping (adjust as needed)
appointments.getChildren().add(appointmentLabel);
});
condition.setText("Condition: " + person.getCondition().value);
bloodType.setText("Blood Type: " + person.getBloodType().value);
emergencyContact.setText("Emergency Contact: " + person.getEmergencyContact().value);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/view/AppointmentListCard.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Insets top="5" right="5" bottom="5" left="15"/>
</padding>
<HBox spacing="5" alignment="CENTER_LEFT">
<Label fx:id="id" styleClass="cell_big_label">
<Label fx:id="id" styleClass="cell_big_label" style="-fx-font-weight: bold;">
<minWidth>
<!-- Ensures that the label text is never truncated -->
<Region fx:constant="USE_PREF_SIZE"/>
Expand Down
Loading

0 comments on commit 5063b9d

Please sign in to comment.