|
@@ -1,5 +1,7 @@
|
|
package org.cryptomator.ui.mainwindow;
|
|
package org.cryptomator.ui.mainwindow;
|
|
|
|
|
|
|
|
+import javafx.beans.binding.Bindings;
|
|
|
|
+import javafx.beans.binding.BooleanBinding;
|
|
import javafx.fxml.FXML;
|
|
import javafx.fxml.FXML;
|
|
import javafx.scene.input.MouseEvent;
|
|
import javafx.scene.input.MouseEvent;
|
|
import javafx.scene.layout.Region;
|
|
import javafx.scene.layout.Region;
|
|
@@ -27,15 +29,17 @@ public class ResizeController implements FxController {
|
|
public Region bResizer;
|
|
public Region bResizer;
|
|
public Region lResizer;
|
|
public Region lResizer;
|
|
|
|
|
|
-
|
|
|
|
private double origX, origY, origW, origH;
|
|
private double origX, origY, origW, origH;
|
|
|
|
|
|
private final Settings settings;
|
|
private final Settings settings;
|
|
|
|
|
|
|
|
+ private final BooleanBinding showResizingArrows;
|
|
|
|
+
|
|
@Inject
|
|
@Inject
|
|
ResizeController(@MainWindow Stage window, Settings settings) {
|
|
ResizeController(@MainWindow Stage window, Settings settings) {
|
|
this.window = window;
|
|
this.window = window;
|
|
this.settings = settings;
|
|
this.settings = settings;
|
|
|
|
+ this.showResizingArrows = Bindings.createBooleanBinding(this::isShowResizingArrows, window.fullScreenProperty());
|
|
}
|
|
}
|
|
|
|
|
|
@FXML
|
|
@FXML
|
|
@@ -72,8 +76,7 @@ public class ResizeController implements FxController {
|
|
// if the position is illegal, then the window appears on the main screen in the middle of the window.
|
|
// if the position is illegal, then the window appears on the main screen in the middle of the window.
|
|
window.setY((window.getMaxHeight() - window.getHeight()) / 2);
|
|
window.setY((window.getMaxHeight() - window.getHeight()) / 2);
|
|
window.setX((window.getMaxWidth() - window.getWidth()) / 2);
|
|
window.setX((window.getMaxWidth() - window.getWidth()) / 2);
|
|
- }
|
|
|
|
- else {
|
|
|
|
|
|
+ } else {
|
|
window.setX(settings.windowXPositionProperty().get());
|
|
window.setX(settings.windowXPositionProperty().get());
|
|
window.setY(settings.windowYPositionProperty().get());
|
|
window.setY(settings.windowYPositionProperty().get());
|
|
}
|
|
}
|
|
@@ -152,9 +155,13 @@ public class ResizeController implements FxController {
|
|
settings.windowXPositionProperty().setValue(window.getX());
|
|
settings.windowXPositionProperty().setValue(window.getX());
|
|
}
|
|
}
|
|
|
|
|
|
- public boolean isShowResizingArrows(){
|
|
|
|
- //If in fullscreen resizing should not be possible
|
|
|
|
- return window.isFullScreen();
|
|
|
|
|
|
+ public BooleanBinding showResizingArrowsProperty() {
|
|
|
|
+ return showResizingArrows;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean isShowResizingArrows() {
|
|
|
|
+ //If in fullscreen resizing should not be possible;
|
|
|
|
+ return !window.isFullScreen();
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|