From 5b83456e6df0a3522e323cca621eeb60d7c2b821 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Tue, 10 Sep 2019 10:07:51 +0200 Subject: [PATCH] fxml cleanup --- .../ui/mainwindow/MainWindowController.java | 20 +++++++++---------- .../src/main/resources/fxml/main_window.fxml | 18 +++++++++-------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/main/ui/src/main/java/org/cryptomator/ui/mainwindow/MainWindowController.java b/main/ui/src/main/java/org/cryptomator/ui/mainwindow/MainWindowController.java index 29a87e1fb..62dbcde07 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/mainwindow/MainWindowController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/mainwindow/MainWindowController.java @@ -1,11 +1,11 @@ package org.cryptomator.ui.mainwindow; import javafx.beans.binding.BooleanBinding; -import javafx.beans.binding.IntegerBinding; import javafx.collections.ObservableList; import javafx.fxml.FXML; import javafx.scene.input.TransferMode; import javafx.scene.layout.HBox; +import javafx.scene.layout.Pane; import javafx.scene.layout.Region; import javafx.scene.layout.VBox; import javafx.stage.Stage; @@ -39,8 +39,8 @@ public class MainWindowController implements FxController { private final VaultFactory vaultFactory; private final WrongFileAlertComponent.Builder wrongFileAlert; public HBox titleBar; - public VBox dragAndDropRegion; - public VBox dragNDropIndicator; + public VBox root; + public Pane dragAndDropIndicator; public Region resizer; private double xOffset; private double yOffset; @@ -75,18 +75,18 @@ public class MainWindowController implements FxController { window.setHeight(event.getSceneY()); }); updateChecker.automaticallyCheckForUpdatesIfEnabled(); - dragNDropIndicator.setVisible(false); - dragAndDropRegion.setOnDragOver(event -> { - if (event.getGestureSource() != dragAndDropRegion && event.getDragboard().hasFiles()) { + dragAndDropIndicator.setVisible(false); + root.setOnDragOver(event -> { + if (event.getGestureSource() != root && event.getDragboard().hasFiles()) { /* allow for both copying and moving, whatever user chooses */ event.acceptTransferModes(TransferMode.COPY_OR_MOVE); - dragNDropIndicator.setVisible(true); + dragAndDropIndicator.setVisible(true); } event.consume(); }); - dragAndDropRegion.setOnDragExited(event -> dragNDropIndicator.setVisible(false)); - dragAndDropRegion.setOnDragDropped(event -> { - if (event.getGestureSource() != dragAndDropRegion && event.getDragboard().hasFiles()) { + root.setOnDragExited(event -> dragAndDropIndicator.setVisible(false)); + root.setOnDragDropped(event -> { + if (event.getGestureSource() != root && event.getDragboard().hasFiles()) { /* allow for both copying and moving, whatever user chooses */ event.acceptTransferModes(TransferMode.COPY_OR_MOVE); File dropped = event.getDragboard().getFiles().get(0); diff --git a/main/ui/src/main/resources/fxml/main_window.fxml b/main/ui/src/main/resources/fxml/main_window.fxml index cb41e476b..cdc8f68e6 100644 --- a/main/ui/src/main/resources/fxml/main_window.fxml +++ b/main/ui/src/main/resources/fxml/main_window.fxml @@ -11,9 +11,10 @@ + @@ -50,12 +51,13 @@ - - - - - - + + + + + + +