From 3d04ce4686c1fb739de2a420ffec81009f1a3271 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Sun, 12 Apr 2020 18:40:31 +0200 Subject: [PATCH] drag over highlight --- .../com/sparrowwallet/sparrow/AppController.java | 9 +++++++++ src/main/resources/com/sparrowwallet/sparrow/app.css | 12 ++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index 2b9c95a6..b62fdfa6 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -32,6 +32,7 @@ import java.util.ResourceBundle; public class AppController implements Initializable { private static final String TRANSACTION_TAB_TYPE = "transaction"; + public static final String DRAG_OVER_CLASS = "drag-over"; @FXML private CheckMenuItem showTxHex; @@ -70,6 +71,14 @@ public class AppController implements Initializable { event.consume(); }); + rootStack.setOnDragEntered(event -> { + rootStack.getStyleClass().add(DRAG_OVER_CLASS); + }); + + rootStack.setOnDragExited(event -> { + rootStack.getStyleClass().removeAll(DRAG_OVER_CLASS); + }); + tabs.getSelectionModel().selectedItemProperty().addListener((observable, old_val, selectedTab) -> { if(selectedTab != null) { String tabType = (String)selectedTab.getUserData(); diff --git a/src/main/resources/com/sparrowwallet/sparrow/app.css b/src/main/resources/com/sparrowwallet/sparrow/app.css index 20b01d14..f516d79a 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/app.css +++ b/src/main/resources/com/sparrowwallet/sparrow/app.css @@ -1,5 +1,5 @@ .background-box { - -fx-stroke: #696c77; + -fx-stroke: #a0a1a7; -fx-stroke-width: 1px; -fx-stroke-dash-array: 5 5; -fx-arc-height: 50; @@ -7,7 +7,15 @@ -fx-fill: transparent; } +.drag-over > .background-box { + -fx-stroke: #383a42; +} + .background-text { - -fx-fill: #696c77; + -fx-fill: #a0a1a7; -fx-font-size: 20; } + +.drag-over > .background-text { + -fx-fill: #383a42; +}