mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-04-12 18:30:26 +08:00
fix: #759
This commit is contained in:
parent
c60261d917
commit
2de6a45ca1
HMCL/src/main/java/org/jackhuang/hmcl/ui/decorator
@ -226,9 +226,16 @@ public class Decorator extends Control {
|
||||
}
|
||||
|
||||
public void capableDraggingWindow(Node node) {
|
||||
node.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> allowMove.set(true));
|
||||
node.addEventHandler(MouseEvent.MOUSE_MOVED, e -> allowMove.set(true));
|
||||
node.addEventHandler(MouseEvent.MOUSE_EXITED, e -> {
|
||||
if (!isDragging()) allowMove.set(false);
|
||||
});
|
||||
}
|
||||
|
||||
public void forbidDraggingWindow(Node node) {
|
||||
node.addEventHandler(MouseEvent.MOUSE_MOVED, e -> {
|
||||
allowMove.set(false);
|
||||
e.consume();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -307,6 +307,7 @@ public class DecoratorController {
|
||||
|
||||
dialog.setContent(dialogPane);
|
||||
decorator.capableDraggingWindow(dialog);
|
||||
decorator.forbidDraggingWindow(dialogPane);
|
||||
dialog.setDialogContainer(decorator.getDrawerWrapper());
|
||||
dialog.setOverlayClose(false);
|
||||
dialog.show();
|
||||
|
Loading…
x
Reference in New Issue
Block a user