From 5258a7dc1205229bffc888eee14474cfe9ae7fdd Mon Sep 17 00:00:00 2001 From: DieGurke <55625494+DieGurke@users.noreply.github.com> Date: Wed, 22 Jul 2020 00:03:12 +0200 Subject: [PATCH] Adjusted message rendering --- .../src/main/java/envoy/client/ui/controller/ChatScene.java | 2 +- .../main/java/envoy/client/ui/listcell/MessageControl.java | 2 +- .../main/java/envoy/client/ui/listcell/MessageListCell.java | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/client/src/main/java/envoy/client/ui/controller/ChatScene.java b/client/src/main/java/envoy/client/ui/controller/ChatScene.java index 4b4ea9b..bcf4388 100644 --- a/client/src/main/java/envoy/client/ui/controller/ChatScene.java +++ b/client/src/main/java/envoy/client/ui/controller/ChatScene.java @@ -317,7 +317,7 @@ public final class ChatScene implements Restorable { recipientProfilePic.setClip(clip); messageSearchButton.setVisible(true); - } + } } /** 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 3da2ec8..711fabd 100644 --- a/client/src/main/java/envoy/client/ui/listcell/MessageControl.java +++ b/client/src/main/java/envoy/client/ui/listcell/MessageControl.java @@ -36,7 +36,7 @@ import envoy.util.EnvoyLog; * * @author Leon Hofmeister * @author Maximilian Käfer - * @since Envoy Client v0.2-beta + * @since Envoy Client v0.1-beta */ public class MessageControl extends Label { 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 9e194df..2027369 100644 --- a/client/src/main/java/envoy/client/ui/listcell/MessageListCell.java +++ b/client/src/main/java/envoy/client/ui/listcell/MessageListCell.java @@ -30,8 +30,10 @@ public final class MessageListCell extends AbstractListCell { - int padding = Math.min(100, newValue.intValue() / 10); - setPadding(new Insets(0, padding, 0, padding)); + int padding = 0; + if (newValue.intValue() > 1020) padding = (newValue.intValue() - 1000) / 2; + else padding = 10; + setPadding(new Insets(0, padding, 6, padding)); }); if (control.isOwnMessage()) setAlignment(Pos.CENTER_RIGHT); else setAlignment(Pos.CENTER_LEFT);