forked from Apple-2-Tools/jace
Issue #27: Updated recent changes to only change window within the UI thread.
This commit is contained in:
parent
abbe5d007e
commit
3123ee1eec
@ -264,9 +264,11 @@ public class EmulatorUILogic implements Reconfigurable {
|
|||||||
alternatives = "fullscreen,maximize",
|
alternatives = "fullscreen,maximize",
|
||||||
defaultKeyMapping = "ctrl+shift+f")
|
defaultKeyMapping = "ctrl+shift+f")
|
||||||
public static void toggleFullscreen() {
|
public static void toggleFullscreen() {
|
||||||
Stage stage = JaceApplication.getApplication().primaryStage;
|
Platform.runLater(() -> {
|
||||||
stage.setFullScreenExitKeyCombination(KeyCombination.NO_MATCH);
|
Stage stage = JaceApplication.getApplication().primaryStage;
|
||||||
stage.setFullScreen(!stage.isFullScreen());
|
stage.setFullScreenExitKeyCombination(KeyCombination.NO_MATCH);
|
||||||
|
stage.setFullScreen(!stage.isFullScreen());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@InvokableAction(
|
@InvokableAction(
|
||||||
@ -384,6 +386,7 @@ public class EmulatorUILogic implements Reconfigurable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int size = -1;
|
static int size = -1;
|
||||||
|
|
||||||
@InvokableAction(
|
@InvokableAction(
|
||||||
name = "Resize window",
|
name = "Resize window",
|
||||||
category = "general",
|
category = "general",
|
||||||
@ -391,24 +394,26 @@ 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;",
|
alternatives = "Adjust screen;Adjust window size;Adjust aspect ratio;Fix screen;Fix window size;Fix aspect ratio;Correct aspect ratio;",
|
||||||
defaultKeyMapping = {"ctrl+shift+a"})
|
defaultKeyMapping = {"ctrl+shift+a"})
|
||||||
public static void scaleIntegerRatio() {
|
public static void scaleIntegerRatio() {
|
||||||
JaceApplication.getApplication().primaryStage.setFullScreen(false);
|
Platform.runLater(() -> {
|
||||||
size++;
|
JaceApplication.getApplication().primaryStage.setFullScreen(false);
|
||||||
if (size > 2) {
|
size++;
|
||||||
size = 0;
|
if (size > 2) {
|
||||||
}
|
size = 0;
|
||||||
switch (size) {
|
}
|
||||||
case 0:
|
switch (size) {
|
||||||
JaceApplication.getApplication().primaryStage.setWidth(560);
|
case 0:
|
||||||
JaceApplication.getApplication().primaryStage.setHeight(384);
|
JaceApplication.getApplication().primaryStage.setWidth(560);
|
||||||
break;
|
JaceApplication.getApplication().primaryStage.setHeight(384);
|
||||||
case 1:
|
break;
|
||||||
JaceApplication.getApplication().primaryStage.setWidth(840);
|
case 1:
|
||||||
JaceApplication.getApplication().primaryStage.setHeight(576);
|
JaceApplication.getApplication().primaryStage.setWidth(840);
|
||||||
break;
|
JaceApplication.getApplication().primaryStage.setHeight(576);
|
||||||
default:
|
break;
|
||||||
JaceApplication.getApplication().primaryStage.setWidth(1020);
|
default:
|
||||||
JaceApplication.getApplication().primaryStage.setHeight(768);
|
JaceApplication.getApplication().primaryStage.setWidth(1020);
|
||||||
}
|
JaceApplication.getApplication().primaryStage.setHeight(768);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean confirm(String message) {
|
public static boolean confirm(String message) {
|
||||||
|
Loading…
Reference in New Issue
Block a user