From b4397fe2f23da397c4c9de9bac40b49cdb80fdbd Mon Sep 17 00:00:00 2001 From: DieGurke Date: Sat, 22 Aug 2020 21:50:05 +0200 Subject: [PATCH] contactSearchTab --- .../envoy/client/ui/controller/ChatScene.java | 18 ++++++++++-------- client/src/main/resources/css/base.css | 8 ++++++++ client/src/main/resources/fxml/ChatScene.fxml | 3 +-- .../main/resources/fxml/ContactSearchTab.fxml | 11 +++++++++++ client/src/main/resources/fxml/Test.fxml | 10 ---------- 5 files changed, 30 insertions(+), 20 deletions(-) create mode 100644 client/src/main/resources/fxml/ContactSearchTab.fxml delete mode 100644 client/src/main/resources/fxml/Test.fxml diff --git a/client/src/main/java/envoy/client/ui/controller/ChatScene.java b/client/src/main/java/envoy/client/ui/controller/ChatScene.java index 62bd6bf..3536603 100644 --- a/client/src/main/java/envoy/client/ui/controller/ChatScene.java +++ b/client/src/main/java/envoy/client/ui/controller/ChatScene.java @@ -28,6 +28,7 @@ import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyEvent; +import javafx.scene.layout.AnchorPane; import javafx.scene.layout.GridPane; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; @@ -128,6 +129,9 @@ public final class ChatScene implements Restorable { @FXML private TabPane tabPane; + + @FXML + private Tab contactSearchTab; private LocalDB localDB; private Client client; @@ -177,14 +181,11 @@ public final class ChatScene implements Restorable { clip.setArcWidth(43); clientProfilePic.setClip(clip); -// FXMLLoader loader = new FXMLLoader(); -// -// try { -// URL url = new File("src/main/resources/fxml/Test.fxml").toURI().toURL(); -// contactOperations.getChildren().add(0, loader.load(url)); -// } catch (Exception e2) { -// e2.printStackTrace(); -// } + try { + contactSearchTab.setContent(FXMLLoader.load(new File("src/main/resources/fxml/ContactSearchTab.fxml").toURI().toURL())); + } catch (Exception e2) { + e2.printStackTrace(); + } // Listen to received messages eventBus.register(MessageCreationEvent.class, e -> { @@ -393,6 +394,7 @@ public final class ChatScene implements Restorable { private void addContactButtonClicked() { // sceneContext.load(SceneContext.SceneInfo.CONTACT_SEARCH_SCENE); // sceneContext.getController().initializeData(sceneContext, localDB); + tabPane.getSelectionModel().select(1); } @FXML diff --git a/client/src/main/resources/css/base.css b/client/src/main/resources/css/base.css index 4c289bb..9495823 100644 --- a/client/src/main/resources/css/base.css +++ b/client/src/main/resources/css/base.css @@ -134,3 +134,11 @@ .listElement { -fx-background-color: transparent; } + +.tab-pane { + -fx-tab-max-height: 0 ; +} +.tab-pane .tab-header-area { + visibility: hidden ; + -fx-padding: -20 0 0 0; +} diff --git a/client/src/main/resources/fxml/ChatScene.fxml b/client/src/main/resources/fxml/ChatScene.fxml index cae6396..eb4e80e 100644 --- a/client/src/main/resources/fxml/ChatScene.fxml +++ b/client/src/main/resources/fxml/ChatScene.fxml @@ -104,9 +104,8 @@ - + - diff --git a/client/src/main/resources/fxml/ContactSearchTab.fxml b/client/src/main/resources/fxml/ContactSearchTab.fxml new file mode 100644 index 0000000..f4c0730 --- /dev/null +++ b/client/src/main/resources/fxml/ContactSearchTab.fxml @@ -0,0 +1,11 @@ + + + + + + + + + +