From 6a718238857d3bcf1ede7bb05f8d7b1e0d1e548e Mon Sep 17 00:00:00 2001 From: Sem van der Hoeven Date: Mon, 18 Mar 2019 14:43:15 +0100 Subject: [PATCH] ADD::added stylesheet for login window added style to the buttons, the same as in the register window changed the font of the title changed the font and color of the 'forgot password' link ADD::added display of name on dashboard added initialize method to set the 'welcome back' text to include the username of the user --- .../src/main/java/greenify/client/Application.java | 2 ++ .../client/controller/DashBoardController.java | 9 +++++++++ src/Client/src/main/resources/fxml/dashboard.fxml | 12 +++++++++--- src/Client/src/main/resources/fxml/sample.fxml | 10 +++++++--- .../main/resources/stylesheets/LoginWindowStyle.css | 5 +++++ 5 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 src/Client/src/main/resources/stylesheets/LoginWindowStyle.css diff --git a/src/Client/src/main/java/greenify/client/Application.java b/src/Client/src/main/java/greenify/client/Application.java index 77ae0c0..519055a 100644 --- a/src/Client/src/main/java/greenify/client/Application.java +++ b/src/Client/src/main/java/greenify/client/Application.java @@ -43,6 +43,8 @@ public class Application extends javafx.application.Application { Parent rootNode = load(this.getClass().getClassLoader().getResource("fxml/sample.fxml")); primaryStage.setTitle("Greenify"); Scene scene = new Scene(rootNode); + scene.getStylesheets() + .add(getClass().getClassLoader().getResource("stylesheets/LoginWindowStyle.css").toExternalForm()); primaryStage.setScene(scene); primaryStage.show(); } diff --git a/src/Client/src/main/java/greenify/client/controller/DashBoardController.java b/src/Client/src/main/java/greenify/client/controller/DashBoardController.java index 42db72f..513cb6f 100644 --- a/src/Client/src/main/java/greenify/client/controller/DashBoardController.java +++ b/src/Client/src/main/java/greenify/client/controller/DashBoardController.java @@ -30,6 +30,14 @@ public class DashBoardController { @FXML private Label totalVeganMealCounter; + @FXML + private Label welcomebacktext; + + public void initialize() { + welcomebacktext.setText("Welcome back " + userService.currentUser.getName() + "!"); + } + + /** * displays the dashboard pane. * @param event the event (clicking the button) @@ -39,6 +47,7 @@ public class DashBoardController { dashboardPane.setVisible(true); userPane.setVisible(false); activitiesPane.setVisible(false); + } /** diff --git a/src/Client/src/main/resources/fxml/dashboard.fxml b/src/Client/src/main/resources/fxml/dashboard.fxml index c463ad5..fff823a 100644 --- a/src/Client/src/main/resources/fxml/dashboard.fxml +++ b/src/Client/src/main/resources/fxml/dashboard.fxml @@ -1,5 +1,11 @@ + + + + + + @@ -12,7 +18,7 @@ - + @@ -82,7 +88,7 @@ - + @@ -121,7 +127,7 @@ - + diff --git a/src/Client/src/main/resources/fxml/sample.fxml b/src/Client/src/main/resources/fxml/sample.fxml index ea80989..9087fc3 100644 --- a/src/Client/src/main/resources/fxml/sample.fxml +++ b/src/Client/src/main/resources/fxml/sample.fxml @@ -1,10 +1,14 @@ + + + + @@ -13,15 +17,15 @@ - +