Skip to content

Commit

Permalink
Merge pull request #124 from nreHieW/branch-association
Browse files Browse the repository at this point in the history
UI Changes
  • Loading branch information
nreHieW authored Nov 2, 2023
2 parents 0ea3711 + 253ae76 commit 6a19427
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/main/java/connectify/ui/EntityListPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,18 @@ private Accordion createCompanyAccordion(ObservableList<Company> companyList) {
}
private TitledPane createCompanyPane(Company company) {
TitledPane companyPane = new TitledPane();
// Create a ScrollPane to make the content scrollable
ScrollPane scrollPane = new ScrollPane();
scrollPane.setFitToWidth(true);

companyPane.setText(company.getName().toString() + " (" + company.getPersonList().size() + " people)");
// Create a VBox to hold the information
VBox companyPaneContent = new VBox();

// Add labels and values for each field
VBox infoBox = new VBox();
infoBox.setSpacing(5); // Spacing between each label and value
infoBox.setPadding(new Insets(5, 5, 8, 5)); // Padding around the entire infoBox
infoBox.setPadding(new Insets(10, 10, 10, 10)); // Padding around the entire infoBox

infoBox.getChildren().add( new Label("Industry: " + company.getIndustry()));
infoBox.getChildren().add(new Label("Location: " + company.getLocation()));
Expand All @@ -121,6 +125,8 @@ private TitledPane createCompanyPane(Company company) {
if (company.getPersonList().size() == 0) {
companyPeopleListView.setPlaceholder(new Label("No person in company"));
}
// Set the preferred width of the ListView to match the ScrollPane's width
companyPeopleListView.prefWidthProperty().bind(scrollPane.widthProperty());

// Add the ListView to the VBox to ensure proper layout
VBox listViewBox = new VBox(companyPeopleListView);
Expand All @@ -130,8 +136,10 @@ private TitledPane createCompanyPane(Company company) {
companyPaneContent.getChildren().add(infoBox);
companyPaneContent.getChildren().add(listViewBox);

// Set the content of the TitledPane to the VBox
companyPane.setContent(companyPaneContent);
scrollPane.setContent(companyPaneContent);

// Set the content of the TitledPane to the ScrollPane
companyPane.setContent(scrollPane);
return companyPane;
}

Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/view/DarkTheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
-fx-background-color: #383838;
}

.scroll-pane > .viewport {
-fx-background-color: #383838;
}

.label {
-fx-font-size: 11pt;
-fx-font-family: "Segoe UI Semibold";
Expand Down

0 comments on commit 6a19427

Please sign in to comment.