mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-10 12:26:16 -04:00
parent
7645a600ef
commit
e051c212d1
@ -30,6 +30,8 @@ import javafx.scene.Node;
|
|||||||
import javafx.scene.image.Image;
|
import javafx.scene.image.Image;
|
||||||
import javafx.scene.input.DragEvent;
|
import javafx.scene.input.DragEvent;
|
||||||
import javafx.scene.input.KeyEvent;
|
import javafx.scene.input.KeyEvent;
|
||||||
|
import javafx.scene.input.MouseButton;
|
||||||
|
import javafx.scene.input.MouseEvent;
|
||||||
import javafx.scene.layout.*;
|
import javafx.scene.layout.*;
|
||||||
import javafx.scene.paint.Color;
|
import javafx.scene.paint.Color;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
@ -144,6 +146,18 @@ public class DecoratorController {
|
|||||||
|
|
||||||
// press ESC to go back
|
// press ESC to go back
|
||||||
onEscPressed(navigator, this::back);
|
onEscPressed(navigator, this::back);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// For JavaFX 12+
|
||||||
|
MouseButton button = MouseButton.valueOf("BACK");
|
||||||
|
navigator.addEventFilter(MouseEvent.MOUSE_CLICKED, e -> {
|
||||||
|
if (e.getButton() == button) {
|
||||||
|
back();
|
||||||
|
e.consume();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (IllegalArgumentException ignored) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Decorator getDecorator() {
|
public Decorator getDecorator() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user