mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-04-19 14:33:04 +03:00
[FEUTURE] Сделал консоль в одном окне
This commit is contained in:
parent
5231939302
commit
f0c6c75b14
3 changed files with 27 additions and 37 deletions
|
@ -121,16 +121,10 @@ function initConsoleScene() {
|
|||
if(movePoint === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
consoleStage.setX(event.getScreenX() - movePoint.getX());
|
||||
consoleStage.setY(event.getScreenY() - movePoint.getY());
|
||||
});
|
||||
|
||||
var pane = consoleMenu.lookup("#bar");
|
||||
consoleBar = pane;
|
||||
pane.lookup("#close").setOnAction(function(){
|
||||
consoleStage.hide();
|
||||
});
|
||||
var text = consoleMenu.lookup("#textField");
|
||||
var output = consoleMenu.lookup("#output");
|
||||
var appendFunction = function(line) javafx.application.Platform.runLater(function() output.appendText(line));
|
||||
|
@ -141,7 +135,11 @@ function initConsoleScene() {
|
|||
FunctionalBridge.addPlainOutput(function(string) {
|
||||
appendFunction(string+"\n");
|
||||
})
|
||||
pane.lookup("#hide").setOnAction(function(event) { consoleStage.setIconified(true) });
|
||||
pane.lookup("#close").setOnAction(function(event){ javafx.application.Platform.exit()});
|
||||
pane.lookup("#hide").setOnAction(function(event){ stage.setIconified(true)});
|
||||
pane.lookup("#back").setOnAction(function(){
|
||||
setCurrentScene(menuScene);
|
||||
});
|
||||
|
||||
var pane = consoleMenu.lookup("#consolePane");
|
||||
consolePane = pane;
|
||||
|
@ -223,7 +221,7 @@ function goAuth(event) {
|
|||
|
||||
/* ======== Console ======== */
|
||||
function goConsole(event) {
|
||||
setConsoleCurrentScene(consoleScene);
|
||||
setCurrentScene(consoleScene);
|
||||
}
|
||||
|
||||
/* ======== Settings ======== */
|
||||
|
|
|
@ -11,20 +11,23 @@
|
|||
|
||||
<!-- DrLeonardo Design -->
|
||||
|
||||
<Pane fx:id="background" prefWidth="738.0" xmlns="http://javafx.com/javafx/8.0.201" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<Pane prefHeight="450.0" prefWidth="740.0" xmlns="http://javafx.com/javafx/8.0.201" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<children>
|
||||
<Pane fx:id="bar" layoutX="692.0" prefHeight="425.0" prefWidth="43.0" styleClass="bar">
|
||||
<Pane fx:id="bar" layoutX="694.0" prefHeight="425.0" prefWidth="43.0" styleClass="bar">
|
||||
<children>
|
||||
<JFXButton id="hide" alignment="CENTER" contentDisplay="CENTER" layoutY="45.0" ripplerFill="#646464"
|
||||
text="" textAlignment="CENTER">
|
||||
<JFXButton id="hide" alignment="CENTER" contentDisplay="CENTER" layoutY="45.0" ripplerFill="#646464" text="" textAlignment="CENTER">
|
||||
<graphic>
|
||||
<MaterialDesignIconView fill="WHITE" glyphName="MINUS" size="30" textAlignment="CENTER"/>
|
||||
<MaterialDesignIconView fill="WHITE" glyphName="MINUS" size="30" textAlignment="CENTER" />
|
||||
</graphic>
|
||||
</JFXButton>
|
||||
<JFXButton id="close" alignment="CENTER" contentDisplay="CENTER" ripplerFill="#fb8c8c" text=""
|
||||
textAlignment="CENTER">
|
||||
<JFXButton id="close" alignment="CENTER" contentDisplay="CENTER" ripplerFill="#fb8c8c" text="" textAlignment="CENTER">
|
||||
<graphic>
|
||||
<MaterialDesignIconView fill="WHITE" glyphName="CLOSE" size="30" textAlignment="CENTER"/>
|
||||
<MaterialDesignIconView fill="WHITE" glyphName="CLOSE" size="30" textAlignment="CENTER" />
|
||||
</graphic>
|
||||
</JFXButton>
|
||||
<JFXButton id="back" alignment="CENTER" contentDisplay="CENTER" layoutY="405.0" ripplerFill="#646464" text="" textAlignment="CENTER">
|
||||
<graphic>
|
||||
<MaterialDesignIconView fill="WHITE" glyphName="CHEVRON_LEFT" size="30" textAlignment="CENTER" />
|
||||
</graphic>
|
||||
</JFXButton>
|
||||
</children>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var app, stage, scene, loginScene, menuScene, consoleScene, consoleStage, optionsScene;
|
||||
var app, stage, scene, loginScene, menuScene, consoleScene, optionsScene;
|
||||
var rootPane, loginPane, menuPane, consoleMenu, optionsMenu;
|
||||
|
||||
var LauncherApp = Java.extend(JSApplication, {
|
||||
|
@ -15,11 +15,6 @@ var LauncherApp = Java.extend(JSApplication, {
|
|||
stage.setResizable(false);
|
||||
stage.setTitle(config.title);
|
||||
|
||||
consoleStage = new javafx.stage.Stage();
|
||||
consoleStage.initStyle(javafx.stage.StageStyle.TRANSPARENT);
|
||||
consoleStage.setResizable(false);
|
||||
consoleStage.setTitle(config.title);
|
||||
|
||||
config.icons.forEach(function(icon) {
|
||||
var iconURL = Launcher.getResourceURL(icon).toString();
|
||||
stage.getIcons().add(new javafx.scene.image.Image(iconURL));
|
||||
|
@ -66,12 +61,6 @@ function setCurrentScene(scene) {
|
|||
stage.show();
|
||||
}
|
||||
|
||||
function setConsoleCurrentScene(scene) {
|
||||
consoleStage.setScene(scene);
|
||||
consoleStage.sizeToScene();
|
||||
consoleStage.show();
|
||||
}
|
||||
|
||||
|
||||
function setRootParent(parent) {
|
||||
scene.setRoot(parent);
|
||||
|
|
Loading…
Reference in a new issue