From f817ae6ab3a69773ff0c93776ff1802941f79f12 Mon Sep 17 00:00:00 2001 From: Notmoo Date: Tue, 15 Aug 2017 19:04:47 +0200 Subject: [PATCH] =?UTF-8?q?Module=20Client,=20main=20frame=20:=20ajout=20c?= =?UTF-8?q?oloration=20diff=C3=A9rente=20pour=20le=20bouton=20du=20module?= =?UTF-8?q?=20affich=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pqt/client/gui/main_frame/MainFrameView.java | 16 +++++++++++++++- .../gui/ressources/strings/GUIStringTool.java | 6 ++---- .../client/src/main/resources/dark-theme.css | 10 ++++++++++ 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/main_frame/MainFrameView.java b/Workspace/client/src/main/java/com/pqt/client/gui/main_frame/MainFrameView.java index 12464cab..a802ac71 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/main_frame/MainFrameView.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/main_frame/MainFrameView.java @@ -6,7 +6,9 @@ import com.pqt.client.gui.ressources.components.generics.others.SideBar; import com.pqt.client.gui.ressources.components.generics.others.listeners.ISideBarListener; import com.pqt.client.gui.ressources.strings.GUIStringTool; import com.pqt.core.entities.user_account.Account; +import javafx.application.Platform; import javafx.geometry.Orientation; +import javafx.scene.Node; import javafx.scene.control.Button; import javafx.scene.control.ToolBar; import javafx.scene.layout.BorderPane; @@ -80,7 +82,19 @@ class MainFrameView implements IFXComponent{ void addGuiModule(String moduleName, Pane moduleContent){ Button button = new Button(moduleName); - button.setOnMouseClicked(event->mainPane.setCenter(moduleContent)); + button.getStyleClass().add("menu-button"); + button.setOnMouseClicked(event->{ + moduleListToolbar.getItems() + .stream() + .filter(Button.class::isInstance) + .map(Button.class::cast) + .forEach(b-> b.getStyleClass().remove("menu-button-selected")); + button.getStyleClass().add("menu-button-selected"); + Platform.runLater(()->{ + moduleListToolbar.getItems().forEach(Node::applyCss); + mainPane.setCenter(moduleContent); + }); + }); moduleListToolbar.getItems().add(button); } diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/strings/GUIStringTool.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/strings/GUIStringTool.java index 0e58801d..aa9574d9 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/strings/GUIStringTool.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/strings/GUIStringTool.java @@ -13,8 +13,6 @@ import java.util.EnumSet; //TODO faire ça un peu mieux public class GUIStringTool { - private static String saleIdLabel; - public static String getValidationButtonLabel() { return "Valider"; } @@ -157,11 +155,11 @@ public class GUIStringTool { } public static String getSideBarCollapseButtonLabel() { - return "Hide"; + return "Réduire"; } public static String getSideBarExpandButtonLabel() { - return "Show"; + return "Menu"; } public static String getSaleGuiModuleName() { diff --git a/Workspace/client/src/main/resources/dark-theme.css b/Workspace/client/src/main/resources/dark-theme.css index 7ba8b06a..5049497a 100644 --- a/Workspace/client/src/main/resources/dark-theme.css +++ b/Workspace/client/src/main/resources/dark-theme.css @@ -173,6 +173,16 @@ -fx-background-color: derive(-fx-focus-color,30%); } +.menu-button-selected { + -fx-background-color: #d8d8d8; + -fx-text-fill: #1d1d1d; +} + +.menu-button-selected:hover { + -fx-background-color: white; + -fx-text-fill: #1d1d1d; +} + .progress-indicator { -fx-pref-width: 50; -fx-pref-height: 50;