labelled the name of the room when in it
This commit is contained in:
@@ -44,6 +44,9 @@ public class ClientGuiController implements ClientListener {
|
||||
@FXML
|
||||
private ScrollPane chatPane;
|
||||
|
||||
@FXML
|
||||
private Label roomName;
|
||||
|
||||
public void setClient(Client client) {
|
||||
this.client = client;
|
||||
}
|
||||
@@ -183,11 +186,13 @@ public class ClientGuiController implements ClientListener {
|
||||
*/
|
||||
private void createChatEnv(String roomName) {
|
||||
Platform.runLater(() -> {
|
||||
this.roomName.setText("Room: " + roomName);
|
||||
chatList.getChildren().clear();
|
||||
chatInput.getChildren().clear();
|
||||
Button leaveButton = new Button("Leave room");
|
||||
leaveButton.setOnAction(event -> {
|
||||
client.SendLeaveRoom();
|
||||
this.roomName.setText("");
|
||||
chatList.getChildren().clear();
|
||||
chatInput.getChildren().clear();
|
||||
});
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<BorderPane xmlns="http://javafx.com/javafx"
|
||||
xmlns:fx="http://javafx.com/fxml"
|
||||
fx:controller="client.ClientGuiController"
|
||||
prefHeight="400.0" prefWidth="600.0" styleClass="vue-container" fx:id="vueContainer">
|
||||
prefHeight="400.0" prefWidth="600.0" fx:id="vueContainer">
|
||||
<top>
|
||||
<HBox alignment="CENTER" styleClass="logo-box">
|
||||
<padding>
|
||||
@@ -25,8 +25,8 @@
|
||||
</HBox>
|
||||
</top>
|
||||
<left>
|
||||
<ScrollPane prefWidth="200.0" styleClass="rooms-pane" fx:id="roomsPane" fitToWidth="true">
|
||||
<VBox fx:id="rooms" spacing="10.0" alignment="CENTER" VBox.vgrow="ALWAYS">
|
||||
<ScrollPane prefWidth="200.0" fitToWidth="true">
|
||||
<VBox spacing="10.0" alignment="CENTER" VBox.vgrow="ALWAYS">
|
||||
<Label text="Rooms" styleClass="rooms-label"/>
|
||||
<VBox fx:id="roomList" styleClass="rooms-list" spacing="5.0" VBox.vgrow="ALWAYS" alignment="CENTER"/>
|
||||
</VBox>
|
||||
@@ -34,15 +34,23 @@
|
||||
</left>
|
||||
<center>
|
||||
<BorderPane>
|
||||
<top>
|
||||
<HBox alignment="CENTER">
|
||||
<padding>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
|
||||
</padding>
|
||||
<Label fx:id="roomName" style="-fx-font-size: 18px; -fx-font-weight: bold;"/>
|
||||
</HBox>
|
||||
</top>
|
||||
<center>
|
||||
<ScrollPane styleClass="chat-pane" fx:id="chatPane" fitToWidth="true">
|
||||
<VBox fx:id="chat" spacing="10.0">
|
||||
<ScrollPane fx:id="chatPane" fitToWidth="true">
|
||||
<VBox spacing="10.0">
|
||||
<VBox fx:id="chatList" styleClass="chat-list" spacing="5.0" VBox.vgrow="ALWAYS"/>
|
||||
</VBox>
|
||||
</ScrollPane>
|
||||
</center>
|
||||
<bottom>
|
||||
<HBox fx:id="chatInput" styleClass="chat-input" spacing="5.0" style="-fx-padding: 10;" />
|
||||
<HBox fx:id="chatInput" spacing="5.0" style="-fx-padding: 10;" />
|
||||
</bottom>
|
||||
</BorderPane>
|
||||
</center>
|
||||
|
||||
Reference in New Issue
Block a user