From e7e4c5af42e1d0b80dd3a4274019ded83c46b39c Mon Sep 17 00:00:00 2001 From: DieGurke <55625494+DieGurke@users.noreply.github.com> Date: Thu, 16 Jul 2020 16:02:03 +0200 Subject: [PATCH] Login Scene is not resizable, logo gets loaded correctly --- client/src/main/java/envoy/client/ui/SceneContext.java | 2 ++ .../main/java/envoy/client/ui/controller/LoginScene.java | 7 +++++++ client/src/main/resources/fxml/LoginScene.fxml | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/client/src/main/java/envoy/client/ui/SceneContext.java b/client/src/main/java/envoy/client/ui/SceneContext.java index a027395..dff69be 100644 --- a/client/src/main/java/envoy/client/ui/SceneContext.java +++ b/client/src/main/java/envoy/client/ui/SceneContext.java @@ -125,6 +125,8 @@ public final class SceneContext { sceneStack.push(scene); stage.setScene(scene); + if (sceneInfo == SceneInfo.LOGIN_SCENE) stage.setResizable(false); + else stage.setResizable(true); applyCSS(); stage.sizeToScene(); stage.show(); 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 4a18200..808212d 100644 --- a/client/src/main/java/envoy/client/ui/controller/LoginScene.java +++ b/client/src/main/java/envoy/client/ui/controller/LoginScene.java @@ -11,10 +11,12 @@ import javafx.fxml.FXML; import javafx.geometry.Insets; import javafx.scene.control.*; import javafx.scene.control.Alert.AlertType; +import javafx.scene.image.ImageView; import envoy.client.data.*; import envoy.client.net.Client; import envoy.client.net.WriteProxy; +import envoy.client.ui.IconUtil; import envoy.client.ui.SceneContext; import envoy.client.ui.Startup; import envoy.data.LoginCredentials; @@ -61,6 +63,9 @@ public final class LoginScene { @FXML private Label registerTextLabel; + @FXML + private ImageView logo; + private Client client; private LocalDB localDB; private CacheMap cacheMap; @@ -78,6 +83,8 @@ public final class LoginScene { // Show an alert after an unsuccessful handshake eventBus.register(HandshakeRejection.class, e -> Platform.runLater(() -> { new Alert(AlertType.ERROR, e.get()).showAndWait(); })); + + logo.setImage(IconUtil.loadIcon("envoy_logo")); } /** diff --git a/client/src/main/resources/fxml/LoginScene.fxml b/client/src/main/resources/fxml/LoginScene.fxml index 5f0b872..b4f475f 100644 --- a/client/src/main/resources/fxml/LoginScene.fxml +++ b/client/src/main/resources/fxml/LoginScene.fxml @@ -16,7 +16,7 @@ - +