From 01f81fadac00c69340b2eda979c28cef6d619263 Mon Sep 17 00:00:00 2001 From: DieGurke <55625494+DieGurke@users.noreply.github.com> Date: Sat, 18 Jul 2020 14:41:25 +0200 Subject: [PATCH] Fixed resize problems and some other stuff --- .../client/ui/controller/LoginScene.java | 2 +- .../client/ui/listcell/MessageControl.java | 9 +- .../client/ui/listcell/MessageListCell.java | 6 +- client/src/main/resources/css/base.css | 4 - client/src/main/resources/fxml/ChatScene.fxml | 137 +++++------------- .../icons/dark/.user_icon.png-autosave.kra | Bin 0 -> 216069 bytes .../main/resources/icons/dark/user_icon.png | Bin 39602 -> 39949 bytes 7 files changed, 52 insertions(+), 106 deletions(-) create mode 100644 client/src/main/resources/icons/dark/.user_icon.png-autosave.kra diff --git a/client/src/main/java/envoy/client/ui/controller/LoginScene.java b/client/src/main/java/envoy/client/ui/controller/LoginScene.java index 9a894b4..6140223 100644 --- a/client/src/main/java/envoy/client/ui/controller/LoginScene.java +++ b/client/src/main/java/envoy/client/ui/controller/LoginScene.java @@ -235,7 +235,7 @@ public final class LoginScene { // Load ChatScene sceneContext.pop(); sceneContext.getStage().setMinHeight(400); - sceneContext.getStage().setMinWidth(350); + sceneContext.getStage().setMinWidth(843); sceneContext.load(SceneContext.SceneInfo.CHAT_SCENE); sceneContext.getController().initializeData(sceneContext, localDB, client, writeProxy); } 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 a6ecae5..d2a70f8 100644 --- a/client/src/main/java/envoy/client/ui/listcell/MessageControl.java +++ b/client/src/main/java/envoy/client/ui/listcell/MessageControl.java @@ -37,6 +37,7 @@ import envoy.util.EnvoyLog; public class MessageControl extends Label { private static User client; + private boolean ownMessage; private static final DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm:ss") .withZone(ZoneId.systemDefault()); @@ -95,7 +96,11 @@ public class MessageControl extends Label { statusIcon.setPreserveRatio(true); vbox.getChildren().add(statusIcon); getStyleClass().add("own-message"); - } else getStyleClass().add("received-message"); + ownMessage = true; + } else { + getStyleClass().add("received-message"); + ownMessage = false; + } // Adjusting height and weight of the cell to the corresponding ListView paddingProperty().setValue(new Insets(5, 20, 5, 20)); setContextMenu(contextMenu); @@ -123,4 +128,6 @@ public class MessageControl extends Label { * @since Envoy Client v0.1-beta */ public static void setUser(User client) { MessageControl.client = client; } + + public boolean isOwnMessage() { return ownMessage; } } diff --git a/client/src/main/java/envoy/client/ui/listcell/MessageListCell.java b/client/src/main/java/envoy/client/ui/listcell/MessageListCell.java index 71c2ae2..44c51bb 100644 --- a/client/src/main/java/envoy/client/ui/listcell/MessageListCell.java +++ b/client/src/main/java/envoy/client/ui/listcell/MessageListCell.java @@ -1,5 +1,6 @@ package envoy.client.ui.listcell; +import javafx.geometry.Pos; import javafx.scene.control.ListView; import envoy.data.Message; @@ -15,7 +16,6 @@ import envoy.data.Message; * @since Envoy Client v0.1-beta */ public final class MessageListCell extends AbstractListCell { - /** * @param listView the list view inside of which the cell will be displayed * @since Envoy Client v0.1-beta @@ -25,7 +25,9 @@ public final class MessageListCell extends AbstractListCell - + - - + + - - - - + + + + - + @@ -54,23 +40,19 @@ - + - + -