From 5d2a3b83d257b130f705ab79019b5557566dd107 Mon Sep 17 00:00:00 2001 From: DieGurke <55625494+DieGurke@users.noreply.github.com> Date: Wed, 22 Jul 2020 11:49:32 +0200 Subject: [PATCH] Message Text Line-Wrap works properly now --- .../src/main/java/envoy/client/ui/listcell/MessageControl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/src/main/java/envoy/client/ui/listcell/MessageControl.java b/client/src/main/java/envoy/client/ui/listcell/MessageControl.java index 711fabd..a132b55 100644 --- a/client/src/main/java/envoy/client/ui/listcell/MessageControl.java +++ b/client/src/main/java/envoy/client/ui/listcell/MessageControl.java @@ -10,6 +10,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import javafx.geometry.Insets; +import javafx.geometry.Pos; import javafx.scene.control.ContextMenu; import javafx.scene.control.Label; import javafx.scene.control.MenuItem; @@ -107,6 +108,7 @@ public class MessageControl extends Label { } // Creating the textLabel final var textLabel = new Label(message.getText()); + textLabel.setMaxWidth(430); textLabel.setWrapText(true); vbox.getChildren().add(textLabel); // Setting the message status icon and background color @@ -116,6 +118,7 @@ public class MessageControl extends Label { vbox.getChildren().add(statusIcon); getStyleClass().add("own-message"); ownMessage = true; + hbox.setAlignment(Pos.CENTER_RIGHT); } else { getStyleClass().add("received-message"); ownMessage = false;