mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-18 02:31:27 +00:00
add top, right, bottom and left resizer
This commit is contained in:
@@ -22,6 +22,11 @@ public class ResizeController implements FxController {
|
||||
public Region trResizer;
|
||||
public Region blResizer;
|
||||
public Region brResizer;
|
||||
public Region tResizer;
|
||||
public Region rResizer;
|
||||
public Region bResizer;
|
||||
public Region lResizer;
|
||||
|
||||
|
||||
private double origX, origY, origW, origH;
|
||||
|
||||
@@ -40,10 +45,18 @@ public class ResizeController implements FxController {
|
||||
trResizer.setOnMousePressed(this::startResize);
|
||||
blResizer.setOnMousePressed(this::startResize);
|
||||
brResizer.setOnMousePressed(this::startResize);
|
||||
tResizer.setOnMousePressed(this::startResize);
|
||||
rResizer.setOnMousePressed(this::startResize);
|
||||
bResizer.setOnMousePressed(this::startResize);
|
||||
lResizer.setOnMousePressed(this::startResize);
|
||||
tlResizer.setOnMouseDragged(this::resizeTopLeft);
|
||||
trResizer.setOnMouseDragged(this::resizeTopRight);
|
||||
blResizer.setOnMouseDragged(this::resizeBottomLeft);
|
||||
brResizer.setOnMouseDragged(this::resizeBottomRight);
|
||||
tResizer.setOnMouseDragged(this::resizeTop);
|
||||
rResizer.setOnMouseDragged(this::resizeRight);
|
||||
bResizer.setOnMouseDragged(this::resizeBottom);
|
||||
lResizer.setOnMouseDragged(this::resizeLeft);
|
||||
|
||||
window.setHeight(settings.windowHeightProperty().get());
|
||||
//TODO: remove comments
|
||||
|
||||
@@ -9,9 +9,18 @@
|
||||
<fx:define>
|
||||
<Cursor fx:id="nwResize" fx:constant="NW_RESIZE"/>
|
||||
<Cursor fx:id="neResize" fx:constant="NE_RESIZE"/>
|
||||
<Cursor fx:id="nsResize" fx:constant="N_RESIZE" />
|
||||
<Cursor fx:id="ewResize" fx:constant="E_RESIZE" />
|
||||
|
||||
|
||||
</fx:define>
|
||||
<Region fx:id="tlResizer" cursor="${nwResize}" prefWidth="10" prefHeight="10" maxWidth="-Infinity" maxHeight="-Infinity" AnchorPane.topAnchor="0" AnchorPane.leftAnchor="0"/>
|
||||
<Region fx:id="trResizer" cursor="${neResize}" prefWidth="10" prefHeight="10" maxWidth="-Infinity" maxHeight="-Infinity" AnchorPane.topAnchor="0" AnchorPane.rightAnchor="0"/>
|
||||
<Region fx:id="blResizer" cursor="${neResize}" prefWidth="10" prefHeight="10" maxWidth="-Infinity" maxHeight="-Infinity" AnchorPane.bottomAnchor="0" AnchorPane.leftAnchor="0"/>
|
||||
<Region fx:id="brResizer" cursor="${nwResize}" prefWidth="10" prefHeight="10" maxWidth="-Infinity" maxHeight="-Infinity" AnchorPane.bottomAnchor="0" AnchorPane.rightAnchor="0"/>
|
||||
<Region fx:id="tResizer" cursor="${nsResize}" prefWidth="10" prefHeight="10" maxWidth="-Infinity" maxHeight="-Infinity" AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="10.0" AnchorPane.topAnchor="0.0"/>
|
||||
<Region fx:id="rResizer" cursor="${ewResize}" prefWidth="10" prefHeight="10" maxWidth="-Infinity" maxHeight="-Infinity" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="10.0"/>
|
||||
<Region fx:id="bResizer" cursor="${nsResize}" prefWidth="10" prefHeight="10" maxWidth="-Infinity" maxHeight="-Infinity" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="10.0"/>
|
||||
<Region fx:id="lResizer" cursor="${ewResize}" prefWidth="10" prefHeight="10" maxWidth="-Infinity" maxHeight="-Infinity" AnchorPane.bottomAnchor="10.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="10.0"/>
|
||||
|
||||
</AnchorPane>
|
||||
Reference in New Issue
Block a user