Skip to content

Commit

Permalink
Fix bugs in View
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxunn committed Nov 1, 2023
1 parent 2af02a6 commit 19fb02b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 41 deletions.
27 changes: 14 additions & 13 deletions src/main/java/seedu/address/ui/ViewWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,29 +44,23 @@ public class ViewWindow extends UiPart<Region> {
private Label address;
@FXML
private Label email;

@FXML
private Label keyMilestone;

@FXML
private ImageView keyMilestoneIcon;

@FXML
private ImageView meetingTimeIcon;
@FXML
private Label keyMilestoneTitle;

@FXML
private Label meetingTimeTitle;
@FXML
private HBox meetingTimeBox;

@FXML
private Label meetingTime;
@FXML
private FlowPane tags;

@FXML
private Label otherInfo;
@FXML
private Label additionalInfoLabel;

/**
* Creates a {@code PersonCode} with the given {@code Person} and index to display.
*/
Expand All @@ -78,7 +72,8 @@ public ViewWindow(Person person, int displayedIndex) {
phone.setText(person.getPhone().value);
address.setText(person.getAddress().value);
email.setText(person.getEmail().value);

logger.info("person" + person.isLead());
logger.info("has meeting time:" + person.getMeetingTime().isPresent());
if (person.isLead()) {
Lead convertedPerson = (Lead) person;
keyMilestoneIcon.setVisible(true);
Expand All @@ -90,11 +85,17 @@ public ViewWindow(Person person, int displayedIndex) {
keyMilestone.setManaged(false);
keyMilestoneTitle.setManaged(false);
}

if (person.getMeetingTime().isPresent()) {
meetingTime.setText(person.getMeetingTimeString());
meetingTimeTitle.setManaged(true);
meetingTime.setManaged(true);
meetingTimeIcon.setVisible(true);
} else {
meetingTime.setText("");
meetingTimeBox.setVisible(false);
meetingTimeIcon.setVisible(false);
meetingTimeBox.setManaged(false);
meetingTime.setManaged(false);
meetingTimeTitle.setManaged(false);
}
Label label = new Label(person.getType().value);
if (person.isClient()) {
Expand Down
13 changes: 8 additions & 5 deletions src/main/resources/view/ViewWindow.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
-fx-background-radius: 10;
}

#additionalInfoBox {
-fx-padding: -20 0 0 0;
-fx-font-weight: bold;

}
.label {
-fx-font-family: "Arial";
-fx-font-size: 18px;
-fx-text-fill: black;
}

#additionalInfoBox {
-fx-font-weight: bold;
-fx-padding: -20 0 0 0;
}

.cell_big_label {
-fx-font-size: 24px;
-fx-font-weight: bold;
Expand All @@ -27,3 +27,6 @@
-fx-text-fill: black;
-fx-padding: 5px;
}



44 changes: 21 additions & 23 deletions src/main/resources/view/ViewWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -78,40 +78,38 @@
<Region prefHeight="20" />
<Separator prefWidth="150" HBox.hgrow="ALWAYS" />
<Region prefHeight="20" />
<HBox fx:id = "additionalInfoBox" spacing="0" alignment="CENTER_LEFT">
<HBox fx:id="additionalInfoBox" alignment="CENTER_LEFT">
<Label styleClass="cell_small_label">
<text>Additional Information:</text>
</Label>
</HBox>
<HBox spacing="5" alignment="CENTER_LEFT">
<HBox fx:id="meetingTimeBox" spacing="3" alignment="CENTER_LEFT">
<ImageView fx:id="meetingTimeIcon" fitHeight="16" fitWidth="16">
<VBox spacing="5" alignment="CENTER_LEFT">
<HBox fx:id="meetingTimeBox" spacing="5" alignment="CENTER_LEFT">
<ImageView fx:id="meetingTimeIcon" fitHeight="16" fitWidth="16" visible="false">
<image>
<Image url="@/images/clock.png" />
</image>
</ImageView>
<Label fx:id="meetingTimeTitle" styleClass="cell_small_label" managed="true">
<text>Meeting Time:</text>
</Label>
<Label fx:id="meetingTime" styleClass="cell_small_label" />
</HBox>
<HBox spacing="5" alignment="CENTER_LEFT">
<ImageView fx:id="keyMilestoneIcon" fitHeight="16" fitWidth="16" visible="false">
<image>
<Image url="@/images/clock.png" />
<Image url="@/images/milestone.png" />
</image>
</ImageView>
<Label styleClass="cell_small_label">
<text>Meeting Time:</text>
<Label fx:id="keyMilestoneTitle" styleClass="cell_small_label" managed="false">
<text>Key Milestone:</text>
</Label>
<Label fx:id="meetingTime" styleClass="cell_small_label" />
<Label fx:id="keyMilestone" styleClass="cell_small_label"/>
</HBox>

<ImageView fx:id="keyMilestoneIcon" fitHeight="16" fitWidth="16" visible="false">
<image>
<Image url="@/images/milestone.png" />
</image>
</ImageView>
<Label fx:id="keyMilestoneTitle" styleClass="cell_small_label" managed="false">
<text>Key Milestone:</text>
</Label>
<Label fx:id="keyMilestone" styleClass="cell_small_label" text="\$keyMilestone" managed="false"/>
</HBox>
<HBox spacing="5" alignment="CENTER_LEFT">
<Label fx:id="otherInfo" styleClass="cell_small_label" />
</HBox>
</VBox>
</VBox>
</GridPane>
<stylesheets>
<URL value="@ViewWindow.css" />
</stylesheets>
</HBox>
</HBox>

0 comments on commit 19fb02b

Please sign in to comment.