From 85e7f288395d07b3b8c0a71ff86560f5009640ba Mon Sep 17 00:00:00 2001 From: DieGurke <55625494+DieGurke@users.noreply.github.com> Date: Sun, 5 Jul 2020 13:53:00 +0200 Subject: [PATCH] Fixed display type of messages in all chats --- src/main/java/envoy/client/ui/listcell/MessageControl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/envoy/client/ui/listcell/MessageControl.java b/src/main/java/envoy/client/ui/listcell/MessageControl.java index d68acdd..a2632e8 100644 --- a/src/main/java/envoy/client/ui/listcell/MessageControl.java +++ b/src/main/java/envoy/client/ui/listcell/MessageControl.java @@ -42,12 +42,14 @@ public class MessageControl extends VBox { textLabel.setWrapText(true); getChildren().add(textLabel); // Setting the message status icon and background color - if (message.getRecipientID() != client.getID()) { + if (message.getSenderID() == client.getID()) { final var statusIcon = new ImageView(statusImages.get(message.getStatus())); statusIcon.setPreserveRatio(true); getChildren().add(statusIcon); getStyleClass().add("own-message"); - } else getStyleClass().add("received-message"); + } else { + getStyleClass().add("received-message"); + } // Adjusting height and weight of the cell to the corresponding ListView paddingProperty().setValue(new Insets(5, 20, 5, 20)); }