From: Debayan Sutradhar Date: Thu, 27 May 2021 22:19:22 +0530 Subject: Added highlighting of action box on clicked --- Added highlighting of action box on clicked --- --- 'a/src/main/java/com/stream_pi/server/window/dashboard/actiondetailpane/ActionDetailsPane.java' +++ b/src/main/java/com/stream_pi/server/window/dashboard/actiondetailpane/ActionDetailsPane.java @@ -537,6 +537,7 @@ public class ActionDetailsPane extends V setAction(action); this.actionBox = actionBox; + actionBox.setSelected(true); renderActionProperties(); } @@ -610,7 +611,12 @@ public class ActionDetailsPane extends V if(actionNull) { action = null; - actionBox = null; + + if(actionBox !=null) + { + actionBox.setSelected(false); + actionBox = null; + } } } --- 'a/src/main/java/com/stream_pi/server/window/dashboard/actiongridpane/ActionBox.java' +++ b/src/main/java/com/stream_pi/server/window/dashboard/actiongridpane/ActionBox.java @@ -261,6 +261,12 @@ public class ActionBox extends StackPane try { actionDetailsPaneListener.onActionClicked(action, this); + + if(mouseEvent.getButton().equals(MouseButton.SECONDARY)) + { + actionContextMenu.show(this, mouseEvent.getScreenX(), + mouseEvent.getScreenY()); + } } catch (MinorException e) { @@ -268,12 +274,6 @@ public class ActionBox extends StackPane e.printStackTrace(); } } - - if(mouseEvent.getButton().equals(MouseButton.SECONDARY)) - { - actionContextMenu.show(this, mouseEvent.getScreenX(), - mouseEvent.getScreenY()); - } } }); @@ -603,4 +603,16 @@ public class ActionBox extends StackPane if(!colour.isEmpty()) setStyle("-fx-background-color : "+colour); } + + public void setSelected(boolean status) + { + if(status) + { + getStyleClass().add("action_box_selected"); + } + else + { + getStyleClass().remove("action_box_selected"); + } + } } --- 'a/src/main/resources/com/stream_pi/server/style.css' +++ b/src/main/resources/com/stream_pi/server/style.css @@ -282,4 +282,9 @@ .about_license_contributors_disclaimer_label { -fx-min-height : 50; +} + +.action_box_selected +{ + -fx-effect: dropshadow(gaussian, rgba(0, 0, 0, 0.3), 10, 0.5, 0.0, 0.0); } \ No newline at end of file