Skip to content

Commit

Permalink
Resolve address hidden problem
Browse files Browse the repository at this point in the history
  • Loading branch information
SHni99 committed Mar 25, 2023
1 parent 810310c commit df3c5c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/main/java/seedu/address/ui/PersonalPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Region;
import javafx.scene.text.TextAlignment;
import seedu.address.model.person.Person;
import seedu.address.model.tag.Tag;
import seedu.address.model.util.ImageUtil;
Expand Down Expand Up @@ -68,7 +69,12 @@ public PersonalPane(Person person) {
status.setText(person.getStatus().fullStatusDetail);
phone.setText(person.getPhone().value);
address.setText(person.getAddress().value);
address.setWrapText(true);
if (address.getText().length() > 35) {
address.setWrapText(true);
}
if (address.isWrapText()) {
address.setTranslateY(10);
}
email.setText(person.getEmail().value);
person.getTags().stream()
.sorted(Comparator.comparing(tag -> tag.tagName))
Expand Down
5 changes: 2 additions & 3 deletions src/main/resources/view/PersonalPane.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@
<?import javafx.scene.layout.*?>
<?import javafx.scene.image.ImageView?>

<?import javafx.scene.text.Text?>
<HBox id="personalPane" fx:id="personalPane" xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml">
<GridPane HBox.hgrow="ALWAYS">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10" prefWidth="150"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10" prefWidth="200"/>
</columnConstraints>
<VBox GridPane.columnIndex="0" alignment="CENTER">
<padding>
<Insets top="10" right="10" bottom="10" left="10"/>
</padding>

<ImageView fx:id="imageView" fitWidth="150" preserveRatio="true">
<ImageView fx:id="imageView" fitWidth="200" fitHeight="160" preserveRatio="true">
</ImageView>
<VBox alignment="CENTER">
<Label fx:id="id" styleClass="cell_big_label">
Expand Down

0 comments on commit df3c5c0

Please sign in to comment.