drag over highlight

This commit is contained in:
Craig Raw 2020-04-12 18:40:31 +02:00
parent 87efdfdd5d
commit 3d04ce4686
2 changed files with 19 additions and 2 deletions

View file

@ -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();

View file

@ -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;
}