From 86e8b4b13948e04785c20c5687b8d566efc57489 Mon Sep 17 00:00:00 2001 From: delvh Date: Fri, 26 Jun 2020 17:33:32 +0200 Subject: [PATCH] Added display of settings-icon for the settings button additionally modified margin of elements in ChatScene --- src/main/java/envoy/client/ui/Startup.java | 2 +- .../envoy/client/ui/controller/ChatScene.java | 11 +- src/main/resources/css/base.css | 10 +- src/main/resources/fxml/ChatScene.fxml | 258 +++++++++++------- 4 files changed, 171 insertions(+), 110 deletions(-) diff --git a/src/main/java/envoy/client/ui/Startup.java b/src/main/java/envoy/client/ui/Startup.java index 0812129..f57b22e 100644 --- a/src/main/java/envoy/client/ui/Startup.java +++ b/src/main/java/envoy/client/ui/Startup.java @@ -35,7 +35,7 @@ public final class Startup extends Application { /** * The version of this client. Used to verify compatibility with the server. - * + * * @since Envoy Client v0.1-beta */ public static final String VERSION = "0.1-beta"; diff --git a/src/main/java/envoy/client/ui/controller/ChatScene.java b/src/main/java/envoy/client/ui/controller/ChatScene.java index 017e58f..106e796 100644 --- a/src/main/java/envoy/client/ui/controller/ChatScene.java +++ b/src/main/java/envoy/client/ui/controller/ChatScene.java @@ -12,6 +12,7 @@ import javafx.collections.FXCollections; import javafx.fxml.FXML; import javafx.scene.control.*; import javafx.scene.control.Alert.AlertType; +import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyEvent; import javafx.scene.paint.Color; @@ -22,9 +23,7 @@ import envoy.client.data.Settings; import envoy.client.event.MessageCreationEvent; import envoy.client.net.Client; import envoy.client.net.WriteProxy; -import envoy.client.ui.ContactListCell; -import envoy.client.ui.MessageListCell; -import envoy.client.ui.SceneContext; +import envoy.client.ui.*; import envoy.data.*; import envoy.event.EventBus; import envoy.event.MessageStatusChange; @@ -90,6 +89,12 @@ public final class ChatScene { messageList.setCellFactory(listView -> new MessageListCell()); userList.setCellFactory(listView -> new ContactListCell()); + try { + settingsButton.setGraphic(new ImageView(IconUtil.load("/icons/settings.png", 16))); + } catch (final IOException e2) { + logger.log(Level.WARNING, "Could not load settings icon", e2); + } + // Listen to received messages eventBus.register(MessageCreationEvent.class, e -> { final var message = e.get(); diff --git a/src/main/resources/css/base.css b/src/main/resources/css/base.css index 727d6e2..f9f1ce2 100644 --- a/src/main/resources/css/base.css +++ b/src/main/resources/css/base.css @@ -21,11 +21,6 @@ -fx-background-color: transparent; } -#remainingCharsLabel { - -fx-text-fill: #00FF00; - -fx-background-color: transparent; -} - .scroll-bar:horizontal, .scroll-bar:horizontal *, .scroll-bar:horizontal > *{ -fx-background-color: transparent; -fx-text-fill: transparent; @@ -58,3 +53,8 @@ -fx-background-radius: 4.0em; -fx-text-alignment: left; } + +#remainingCharsLabel { + -fx-text-fill: #00FF00; + -fx-background-color: transparent; +} diff --git a/src/main/resources/fxml/ChatScene.fxml b/src/main/resources/fxml/ChatScene.fxml index 50aa280..0a65449 100644 --- a/src/main/resources/fxml/ChatScene.fxml +++ b/src/main/resources/fxml/ChatScene.fxml @@ -12,111 +12,167 @@ - + - - - + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +