Issue #27: Updated recent changes to only change window within the UI thread.

This commit is contained in:
Brendan Robert 2016-02-20 22:33:16 -06:00
parent abbe5d007e
commit 3123ee1eec

View File

@ -264,9 +264,11 @@ public class EmulatorUILogic implements Reconfigurable {
alternatives = "fullscreen,maximize",
defaultKeyMapping = "ctrl+shift+f")
public static void toggleFullscreen() {
Platform.runLater(() -> {
Stage stage = JaceApplication.getApplication().primaryStage;
stage.setFullScreenExitKeyCombination(KeyCombination.NO_MATCH);
stage.setFullScreen(!stage.isFullScreen());
});
}
@InvokableAction(
@ -384,6 +386,7 @@ public class EmulatorUILogic implements Reconfigurable {
}
static int size = -1;
@InvokableAction(
name = "Resize window",
category = "general",
@ -391,6 +394,7 @@ public class EmulatorUILogic implements Reconfigurable {
alternatives = "Adjust screen;Adjust window size;Adjust aspect ratio;Fix screen;Fix window size;Fix aspect ratio;Correct aspect ratio;",
defaultKeyMapping = {"ctrl+shift+a"})
public static void scaleIntegerRatio() {
Platform.runLater(() -> {
JaceApplication.getApplication().primaryStage.setFullScreen(false);
size++;
if (size > 2) {
@ -409,6 +413,7 @@ public class EmulatorUILogic implements Reconfigurable {
JaceApplication.getApplication().primaryStage.setWidth(1020);
JaceApplication.getApplication().primaryStage.setHeight(768);
}
});
}
public static boolean confirm(String message) {