From f0c6c75b14912baef7569170f924c903934739b9 Mon Sep 17 00:00:00 2001
From: Alex Dev Sm <leshasmlesha@gmail.com>
Date: Mon, 17 Jun 2019 16:04:28 +0300
Subject: [PATCH] =?UTF-8?q?[FEUTURE]=20=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0?=
 =?UTF-8?q?=D0=BB=20=D0=BA=D0=BE=D0=BD=D1=81=D0=BE=D0=BB=D1=8C=20=D0=B2=20?=
 =?UTF-8?q?=D0=BE=D0=B4=D0=BD=D0=BE=D0=BC=20=D0=BE=D0=BA=D0=BD=D0=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Launcher/runtime/dialog/dialog.js             | 14 +++----
 .../dialog/scenes/console/console.fxml        | 37 ++++++++++---------
 Launcher/runtime/init.js                      | 13 +------
 3 files changed, 27 insertions(+), 37 deletions(-)

diff --git a/Launcher/runtime/dialog/dialog.js b/Launcher/runtime/dialog/dialog.js
index acd7ba4b..bd9796f2 100644
--- a/Launcher/runtime/dialog/dialog.js
+++ b/Launcher/runtime/dialog/dialog.js
@@ -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 ======== */
diff --git a/Launcher/runtime/dialog/scenes/console/console.fxml b/Launcher/runtime/dialog/scenes/console/console.fxml
index 738a5506..17a23c1d 100644
--- a/Launcher/runtime/dialog/scenes/console/console.fxml
+++ b/Launcher/runtime/dialog/scenes/console/console.fxml
@@ -11,24 +11,27 @@
 
 <!-- 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">
-            <children>
-                <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"/>
-                    </graphic>
-                </JFXButton>
-                <JFXButton id="close" alignment="CENTER" contentDisplay="CENTER" ripplerFill="#fb8c8c" text=""
-                           textAlignment="CENTER">
-                    <graphic>
-                        <MaterialDesignIconView fill="WHITE" glyphName="CLOSE" size="30" textAlignment="CENTER"/>
-                    </graphic>
-                </JFXButton>
-            </children>
-        </Pane>
+        <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">
+                   <graphic>
+                       <MaterialDesignIconView fill="WHITE" glyphName="MINUS" size="30" textAlignment="CENTER" />
+                   </graphic>
+               </JFXButton>
+               <JFXButton id="close" alignment="CENTER" contentDisplay="CENTER" ripplerFill="#fb8c8c" text="" textAlignment="CENTER">
+                   <graphic>
+                       <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>
+       </Pane>
         <JFXTextArea fx:id="output" focusColor="#d8d8d8" prefHeight="419.0" prefWidth="692.0" unFocusColor="#ffffff00">
             <padding>
                 <Insets left="10.0" top="10.0"/>
diff --git a/Launcher/runtime/init.js b/Launcher/runtime/init.js
index 1db04f3b..ee0079c3 100644
--- a/Launcher/runtime/init.js
+++ b/Launcher/runtime/init.js
@@ -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);