Fixed display type of messages in all chats

This commit is contained in:
DieGurke 2020-07-05 13:53:00 +02:00
parent 349bf9d34f
commit 1b08076bdb

View File

@ -42,12 +42,14 @@ public class MessageControl extends VBox {
textLabel.setWrapText(true); textLabel.setWrapText(true);
getChildren().add(textLabel); getChildren().add(textLabel);
// Setting the message status icon and background color // 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())); final var statusIcon = new ImageView(statusImages.get(message.getStatus()));
statusIcon.setPreserveRatio(true); statusIcon.setPreserveRatio(true);
getChildren().add(statusIcon); getChildren().add(statusIcon);
getStyleClass().add("own-message"); 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 // Adjusting height and weight of the cell to the corresponding ListView
paddingProperty().setValue(new Insets(5, 20, 5, 20)); paddingProperty().setValue(new Insets(5, 20, 5, 20));
} }