Merge pull request #115 from WiredSpast/master

Added darktheme + Theme switch + Build in Titlebar + Fix of some lighttheme elements
This commit is contained in:
sirjonasxx 2022-02-12 05:15:46 +01:00 committed by GitHub
commit 21aaf49e5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
38 changed files with 1381 additions and 46 deletions

View File

@ -9,15 +9,21 @@ import javafx.application.Platform;
import javafx.fxml.FXMLLoader; import javafx.fxml.FXMLLoader;
import javafx.scene.Parent; import javafx.scene.Parent;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.scene.control.ToolBar;
import javafx.scene.image.Image; import javafx.scene.image.Image;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.stage.Stage; import javafx.stage.Stage;
import javafx.stage.StageStyle;
public class GEarth extends Application { public class GEarth extends Application {
public static Application main; public static Application main;
public static String version = "1.5.1"; public static String version = "1.5.1";
public static String gitApi = "https://api.github.com/repos/sirjonasxx/G-Earth/releases/latest"; public static String gitApi = "https://api.github.com/repos/sirjonasxx/G-Earth/releases/latest";
public static String theme = "G-Earth"; public static String theme = "G-Earth_Dark";
public static String[] themes = new String[] {"G-Earth", "Tanji", "G-Earth_Dark"};
static { static {
if (Cacher.getCacheContents().has("theme")) { if (Cacher.getCacheContents().has("theme")) {
@ -33,19 +39,18 @@ public class GEarth extends Application {
Parent root = loader.load(); Parent root = loader.load();
GEarthController companion = loader.getController(); GEarthController companion = loader.getController();
companion.setStage(primaryStage); companion.setStage(primaryStage);
primaryStage.initStyle(StageStyle.TRANSPARENT);
primaryStage.getIcons().add(new Image(getClass().getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", theme))));
primaryStage.setTitle(theme + " " + version);
// https://stackoverflow.com/questions/20732100/javafx-why-does-stage-setresizablefalse-cause-additional-margins // https://stackoverflow.com/questions/20732100/javafx-why-does-stage-setresizablefalse-cause-additional-margins
// primaryStage.setScene(new Scene(root, 650, 295)); // primaryStage.setScene(new Scene(root, 650, 295));
primaryStage.setScene(new Scene(root)); primaryStage.setScene(new Scene(root));
primaryStage.setResizable(false); primaryStage.setResizable(false);
primaryStage.sizeToScene(); primaryStage.sizeToScene();
primaryStage.show(); primaryStage.getScene().setFill(Color.TRANSPARENT);
primaryStage.getScene().getStylesheets().add(getClass().getResource(String.format("/gearth/themes/%s/styling.css", theme)).toExternalForm()); companion.setTheme(theme);
primaryStage.show();
primaryStage.setOnCloseRequest( event -> { primaryStage.setOnCloseRequest( event -> {
companion.exit(); companion.exit();
Platform.exit(); Platform.exit();

View File

@ -1,11 +1,16 @@
package gearth.misc; package gearth.misc;
import gearth.Main;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.scene.control.Alert; import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType; import javafx.scene.control.ButtonType;
import javafx.scene.image.Image;
import javafx.scene.layout.Region; import javafx.scene.layout.Region;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import java.io.PrintStream; import java.io.PrintStream;
import java.util.Objects;
import java.util.prefs.Preferences; import java.util.prefs.Preferences;
/** /**
@ -44,6 +49,9 @@ public class AdminValidator {
if (!AdminValidator.isAdmin()) { if (!AdminValidator.isAdmin()) {
Platform.runLater(() -> { Platform.runLater(() -> {
Alert alert = new Alert(Alert.AlertType.WARNING, "G-Earth needs admin privileges in order to work on Flash, please restart G-Earth with admin permissions unless you're using Unity", ButtonType.OK); Alert alert = new Alert(Alert.AlertType.WARNING, "G-Earth needs admin privileges in order to work on Flash, please restart G-Earth with admin permissions unless you're using Unity", ButtonType.OK);
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
stage.getIcons().add(new Image(Main.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", Main.theme))));
stage.getScene().getStylesheets().add(Main.class.getResource(String.format("/gearth/themes/%s/styling.css", Main.theme)).toExternalForm());
alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE); alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
alert.setResizable(false); alert.setResizable(false);
alert.show(); alert.show();

View File

@ -1,11 +1,14 @@
package gearth.misc; package gearth.misc;
import gearth.Main;
import javafx.scene.Group; import javafx.scene.Group;
import javafx.scene.Node; import javafx.scene.Node;
import javafx.scene.control.Alert; import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType; import javafx.scene.control.ButtonType;
import javafx.scene.control.CheckBox; import javafx.scene.control.CheckBox;
import javafx.scene.control.DialogPane; import javafx.scene.control.DialogPane;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
@ -23,6 +26,9 @@ public class ConfirmationDialog {
Alert alert = new Alert(type); Alert alert = new Alert(type);
// Need to force the alert to layout in order to grab the graphic, // Need to force the alert to layout in order to grab the graphic,
// as we are replacing the dialog pane with a custom pane // as we are replacing the dialog pane with a custom pane
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
stage.getIcons().add(new Image(Main.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", Main.theme))));
stage.getScene().getStylesheets().add(Main.class.getResource(String.format("/gearth/themes/%s/styling.css", Main.theme)).toExternalForm());
alert.getDialogPane().applyCss(); alert.getDialogPane().applyCss();
Node graphic = alert.getDialogPane().getGraphic(); Node graphic = alert.getDialogPane().getGraphic();
// Create a new dialog pane that has a checkbox instead of the hide/show details button // Create a new dialog pane that has a checkbox instead of the hide/show details button

View File

@ -6,9 +6,11 @@ import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType; import javafx.scene.control.ButtonType;
import javafx.scene.control.Hyperlink; import javafx.scene.control.Hyperlink;
import javafx.scene.control.Label; import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.layout.FlowPane; import javafx.scene.layout.FlowPane;
import javafx.scene.layout.Region; import javafx.scene.layout.Region;
import javafx.scene.web.WebView; import javafx.scene.web.WebView;
import javafx.stage.Stage;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.maven.artifact.versioning.ComparableVersion; import org.apache.maven.artifact.versioning.ComparableVersion;
import org.json.JSONObject; import org.json.JSONObject;
@ -35,6 +37,9 @@ public class UpdateChecker {
boolean isForcedUpdate = body.contains("(!)"); boolean isForcedUpdate = body.contains("(!)");
Alert alert = new Alert(isForcedUpdate ? Alert.AlertType.ERROR : Alert.AlertType.INFORMATION, "G-Earth is outdated!", ButtonType.OK); Alert alert = new Alert(isForcedUpdate ? Alert.AlertType.ERROR : Alert.AlertType.INFORMATION, "G-Earth is outdated!", ButtonType.OK);
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
stage.getIcons().add(new Image(GEarth.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", GEarth.theme))));
stage.getScene().getStylesheets().add(GEarth.class.getResource(String.format("/gearth/themes/%s/styling.css", GEarth.theme)).toExternalForm());
FlowPane fp = new FlowPane(); FlowPane fp = new FlowPane();
Label lbl = new Label("A new version of G-Earth has been found ("+gitv+")" + System.lineSeparator()+ System.lineSeparator() + "Update to the latest version:"); Label lbl = new Label("A new version of G-Earth has been found ("+gitv+")" + System.lineSeparator()+ System.lineSeparator() + "Update to the latest version:");

View File

@ -1,5 +1,6 @@
package gearth.protocol.connection.proxy; package gearth.protocol.connection.proxy;
import gearth.Main;
import gearth.misc.Cacher; import gearth.misc.Cacher;
import gearth.misc.OSValidator; import gearth.misc.OSValidator;
import gearth.protocol.HConnection; import gearth.protocol.HConnection;
@ -12,7 +13,9 @@ import gearth.protocol.connection.proxy.flash.windows.WindowsRawIpFlashProxyProv
import javafx.application.Platform; import javafx.application.Platform;
import javafx.scene.control.Alert; import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType; import javafx.scene.control.ButtonType;
import javafx.scene.image.Image;
import javafx.scene.layout.Region; import javafx.scene.layout.Region;
import javafx.stage.Stage;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
@ -106,6 +109,9 @@ public class ProxyProviderFactory {
Alert alert = new Alert(Alert.AlertType.ERROR, "G-Earth is already connected to this hotel. " + Alert alert = new Alert(Alert.AlertType.ERROR, "G-Earth is already connected to this hotel. " +
"Due to current limitations you can only connect one session per hotel to G-Earth in Raw IP mode on Windows.\n\n" + "Due to current limitations you can only connect one session per hotel to G-Earth in Raw IP mode on Windows.\n\n" +
"You can bypass this by using a SOCKS proxy [Extra -> Advanced -> SOCKS]", ButtonType.OK); "You can bypass this by using a SOCKS proxy [Extra -> Advanced -> SOCKS]", ButtonType.OK);
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
stage.getIcons().add(new Image(Main.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", Main.theme))));
stage.getScene().getStylesheets().add(Main.class.getResource(String.format("/gearth/themes/%s/styling.css", Main.theme)).toExternalForm());
alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE); alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
alert.setResizable(false); alert.setResizable(false);
alert.show(); alert.show();

View File

@ -1,5 +1,6 @@
package gearth.protocol.connection.proxy.flash; package gearth.protocol.connection.proxy.flash;
import gearth.Main;
import gearth.protocol.HConnection; import gearth.protocol.HConnection;
import gearth.protocol.connection.HProxy; import gearth.protocol.connection.HProxy;
import gearth.protocol.connection.HProxySetter; import gearth.protocol.connection.HProxySetter;
@ -13,7 +14,9 @@ import gearth.protocol.packethandler.flash.FlashPacketHandler;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.scene.control.Alert; import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType; import javafx.scene.control.ButtonType;
import javafx.scene.image.Image;
import javafx.scene.layout.Region; import javafx.scene.layout.Region;
import javafx.stage.Stage;
import java.io.IOException; import java.io.IOException;
import java.net.Socket; import java.net.Socket;
@ -121,6 +124,9 @@ public abstract class FlashProxyProvider implements ProxyProvider {
protected void showInvalidConnectionError() { protected void showInvalidConnectionError() {
Platform.runLater(() -> { Platform.runLater(() -> {
Alert alert = new Alert(Alert.AlertType.ERROR, "You entered invalid connection information, G-Earth could not connect", ButtonType.OK); Alert alert = new Alert(Alert.AlertType.ERROR, "You entered invalid connection information, G-Earth could not connect", ButtonType.OK);
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
stage.getIcons().add(new Image(Main.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", Main.theme))));
stage.getScene().getStylesheets().add(Main.class.getResource(String.format("/gearth/themes/%s/styling.css", Main.theme)).toExternalForm());
alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE); alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
alert.setResizable(false); alert.setResizable(false);
alert.show(); alert.show();

View File

@ -1,5 +1,6 @@
package gearth.protocol.connection.proxy.flash; package gearth.protocol.connection.proxy.flash;
import gearth.Main;
import gearth.misc.Cacher; import gearth.misc.Cacher;
import gearth.protocol.HConnection; import gearth.protocol.HConnection;
import gearth.protocol.connection.*; import gearth.protocol.connection.*;
@ -12,6 +13,8 @@ import gearth.protocol.portchecker.PortCheckerFactory;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.scene.control.Alert; import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType; import javafx.scene.control.ButtonType;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import java.io.IOException; import java.io.IOException;
import java.net.*; import java.net.*;
@ -106,6 +109,9 @@ public class NormalFlashProxyProvider extends FlashProxyProvider {
Platform.runLater(() -> { Platform.runLater(() -> {
Alert a = new Alert(Alert.AlertType.ERROR, "The port is in use by " + processName, Alert a = new Alert(Alert.AlertType.ERROR, "The port is in use by " + processName,
ButtonType.OK); ButtonType.OK);
Stage stage = (Stage) a.getDialogPane().getScene().getWindow();
stage.getIcons().add(new Image(Main.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", Main.theme))));
stage.getScene().getStylesheets().add(Main.class.getResource(String.format("/gearth/themes/%s/styling.css", Main.theme)).toExternalForm());
a.showAndWait(); a.showAndWait();
}); });
throw new IOException(e); throw new IOException(e);

View File

@ -1,5 +1,6 @@
package gearth.protocol.connection.proxy.nitro.http; package gearth.protocol.connection.proxy.nitro.http;
import gearth.Main;
import gearth.misc.ConfirmationDialog; import gearth.misc.ConfirmationDialog;
import gearth.protocol.connection.proxy.nitro.NitroConstants; import gearth.protocol.connection.proxy.nitro.NitroConstants;
import gearth.protocol.connection.proxy.nitro.os.NitroOsFunctions; import gearth.protocol.connection.proxy.nitro.os.NitroOsFunctions;
@ -7,6 +8,8 @@ import gearth.protocol.connection.proxy.nitro.os.NitroOsFunctionsFactory;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.scene.control.Alert; import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType; import javafx.scene.control.ButtonType;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import org.littleshoot.proxy.HttpProxyServer; import org.littleshoot.proxy.HttpProxyServer;
import org.littleshoot.proxy.impl.DefaultHttpProxyServer; import org.littleshoot.proxy.impl.DefaultHttpProxyServer;
import org.littleshoot.proxy.mitm.Authority; import org.littleshoot.proxy.mitm.Authority;
@ -53,6 +56,9 @@ public class NitroHttpProxy {
"G-Earth will ask you for Administrator permission if you do so.", "Remember my choice", "G-Earth will ask you for Administrator permission if you do so.", "Remember my choice",
ButtonType.YES, ButtonType.NO ButtonType.YES, ButtonType.NO
); );
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
stage.getIcons().add(new Image(Main.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", Main.theme))));
stage.getScene().getStylesheets().add(Main.class.getResource(String.format("/gearth/themes/%s/styling.css", Main.theme)).toExternalForm());
shouldInstall.set(alert.showAndWait().filter(t -> t == ButtonType.YES).isPresent()); shouldInstall.set(alert.showAndWait().filter(t -> t == ButtonType.YES).isPresent());
waitForDialog.release(); waitForDialog.release();

View File

@ -15,9 +15,11 @@ import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType; import javafx.scene.control.ButtonType;
import javafx.scene.control.Hyperlink; import javafx.scene.control.Hyperlink;
import javafx.scene.control.Label; import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.layout.FlowPane; import javafx.scene.layout.FlowPane;
import javafx.scene.layout.Region; import javafx.scene.layout.Region;
import javafx.scene.web.WebView; import javafx.scene.web.WebView;
import javafx.stage.Stage;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -80,6 +82,9 @@ public class Rc4Obtainer {
Platform.runLater(() -> { Platform.runLater(() -> {
Alert alert = new Alert(Alert.AlertType.WARNING, "Something went wrong!", ButtonType.OK); Alert alert = new Alert(Alert.AlertType.WARNING, "Something went wrong!", ButtonType.OK);
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
stage.getIcons().add(new Image(GEarth.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", GEarth.theme))));
stage.getScene().getStylesheets().add(GEarth.class.getResource(String.format("/gearth/themes/%s/styling.css", GEarth.theme)).toExternalForm());
FlowPane fp = new FlowPane(); FlowPane fp = new FlowPane();
Label lbl = new Label("G-Earth has experienced an issue" + System.lineSeparator()+ System.lineSeparator() + "Head over to our Troubleshooting page to solve the problem:"); Label lbl = new Label("G-Earth has experienced an issue" + System.lineSeparator()+ System.lineSeparator() + "Head over to our Troubleshooting page to solve the problem:");

View File

@ -7,8 +7,10 @@ import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType; import javafx.scene.control.ButtonType;
import javafx.scene.control.Hyperlink; import javafx.scene.control.Hyperlink;
import javafx.scene.control.Label; import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.layout.FlowPane; import javafx.scene.layout.FlowPane;
import javafx.scene.layout.Region; import javafx.scene.layout.Region;
import javafx.stage.Stage;
import java.io.*; import java.io.*;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
@ -168,6 +170,9 @@ public class GPythonShell {
private void showError() { private void showError() {
Platform.runLater(() -> { Platform.runLater(() -> {
Alert alert = new Alert(Alert.AlertType.ERROR, "G-Python error", ButtonType.OK); Alert alert = new Alert(Alert.AlertType.ERROR, "G-Python error", ButtonType.OK);
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
stage.getIcons().add(new Image(GEarth.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", GEarth.theme))));
stage.getScene().getStylesheets().add(GEarth.class.getResource(String.format("/gearth/themes/%s/styling.css", GEarth.theme)).toExternalForm());
alert.setTitle("G-Python error"); alert.setTitle("G-Python error");
FlowPane fp = new FlowPane(); FlowPane fp = new FlowPane();

View File

@ -1,12 +1,13 @@
package gearth.ui; package gearth.ui;
import gearth.GEarth;
import gearth.protocol.connection.proxy.ProxyProviderFactory; import gearth.protocol.connection.proxy.ProxyProviderFactory;
import gearth.protocol.connection.proxy.SocksConfiguration; import gearth.protocol.connection.proxy.SocksConfiguration;
import gearth.ui.logger.loggerdisplays.PacketLoggerFactory; import gearth.ui.logger.loggerdisplays.PacketLoggerFactory;
import javafx.event.Event; import javafx.application.Platform;
import javafx.event.EventHandler; import javafx.scene.control.*;
import javafx.scene.control.Tab; import javafx.scene.image.Image;
import javafx.scene.control.TabPane; import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Pane; import javafx.scene.layout.Pane;
import javafx.stage.Stage; import javafx.stage.Stage;
import gearth.protocol.HConnection; import gearth.protocol.HConnection;
@ -20,6 +21,7 @@ import gearth.ui.extra.ExtraController;
import gearth.ui.tools.ToolsController; import gearth.ui.tools.ToolsController;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
public class GEarthController { public class GEarthController {
@ -41,7 +43,9 @@ public class GEarthController {
private List<SubForm> tabs = null; private List<SubForm> tabs = null;
public Pane mover; public Pane titleBar;
public Label titleLabel;
public GEarthController() { public GEarthController() {
SocksConfiguration temporary_socks = new SocksConfiguration() { SocksConfiguration temporary_socks = new SocksConfiguration() {
public boolean useSocks() { return false; } public boolean useSocks() { return false; }
@ -86,6 +90,8 @@ public class GEarthController {
if (PacketLoggerFactory.usesUIlogger()) { if (PacketLoggerFactory.usesUIlogger()) {
tabBar.getTabs().remove(tab_Logger); tabBar.getTabs().remove(tab_Logger);
} }
} }
public void setStage(Stage stage) { public void setStage(Stage stage) {
@ -117,9 +123,54 @@ public class GEarthController {
loggerController.miniLogText(color, text); loggerController.miniLogText(color, text);
} }
public void setTheme(String theme) {
GEarth.theme = theme;
getStage().getScene().getStylesheets().clear();
getStage().getScene().getStylesheets().add(GEarth.class.getResource(String.format("/gearth/themes/%s/styling.css", theme)).toExternalForm());
getStage().getIcons().clear();
getStage().getIcons().add(new Image(GEarth.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", theme))));
getStage().setTitle(theme.split("_")[0] + " " + GEarth.version);
titleLabel.setText(getStage().getTitle());
infoController.img_logo.setImage(new Image(GEarth.class.getResourceAsStream(String.format("/gearth/themes/%s/logo.png", theme))));
infoController.version.setText(getStage().getTitle());
}
public void exit() { public void exit() {
tabs.forEach(SubForm::exit); tabs.forEach(SubForm::exit);
hConnection.abort(); hConnection.abort();
} }
public void handleCloseAction(MouseEvent event) {
this.exit();
Platform.exit();
// Platform.exit doesn't seem to be enough on Windows?
System.exit(0);
}
public void handleMinimizeAction(MouseEvent event) {
getStage().setIconified(true);
}
private double xOffset, yOffset;
public void handleClickAction(MouseEvent event) {
xOffset = event.getSceneX();
yOffset = event.getSceneY();
}
public void handleMovementAction(MouseEvent event) {
getStage().setX(event.getScreenX() - xOffset);
getStage().setY(event.getScreenY() - yOffset);
}
public void toggleTheme(MouseEvent event) {
int themeIndex = Arrays.asList(GEarth.themes).indexOf(GEarth.theme);
setTheme(GEarth.themes[(themeIndex + 1) % GEarth.themes.length]);
}
} }

View File

@ -13,9 +13,11 @@ import gearth.ui.info.InfoController;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.event.ActionEvent; import javafx.event.ActionEvent;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.image.Image;
import javafx.scene.layout.FlowPane; import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane; import javafx.scene.layout.GridPane;
import javafx.scene.layout.Region; import javafx.scene.layout.Region;
import javafx.stage.Stage;
import org.json.JSONObject; import org.json.JSONObject;
/** /**
@ -173,6 +175,9 @@ public class ExtraController extends SubForm implements SocksConfiguration {
if (!GPythonVersionUtils.validInstallation()) { if (!GPythonVersionUtils.validInstallation()) {
Platform.runLater(() -> { Platform.runLater(() -> {
Alert alert = new Alert(Alert.AlertType.ERROR, "G-Python installation", ButtonType.OK); Alert alert = new Alert(Alert.AlertType.ERROR, "G-Python installation", ButtonType.OK);
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
stage.getIcons().add(new Image(GEarth.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", GEarth.theme))));
stage.getScene().getStylesheets().add(GEarth.class.getResource(String.format("/gearth/themes/%s/styling.css", GEarth.theme)).toExternalForm());
alert.setTitle("G-Python installation"); alert.setTitle("G-Python installation");
FlowPane fp = new FlowPane(); FlowPane fp = new FlowPane();

View File

@ -8,6 +8,7 @@ import javafx.scene.image.Image;
import javafx.scene.image.ImageView; import javafx.scene.image.ImageView;
import javafx.scene.layout.Region; import javafx.scene.layout.Region;
import javafx.scene.web.WebView; import javafx.scene.web.WebView;
import javafx.stage.Stage;
/** /**
* Created by Jonas on 06/04/18. * Created by Jonas on 06/04/18.
@ -33,11 +34,6 @@ public class InfoController extends SubForm {
} }
public void initialize() { public void initialize() {
version.setText(version.getText().replace("$theme", GEarth.theme));
version.setText(version.getText().replace("$version", GEarth.version));
img_logo.setImage(new Image(String.format("/gearth/themes/%s/logo.png", GEarth.theme)));
link_darkbox.setTooltip(new Tooltip("https://darkbox.nl")); link_darkbox.setTooltip(new Tooltip("https://darkbox.nl"));
link_d_gearth.setTooltip(new Tooltip("https://discord.gg/AVkcF8y")); link_d_gearth.setTooltip(new Tooltip("https://discord.gg/AVkcF8y"));
link_g_gearth.setTooltip(new Tooltip("https://github.com/sirjonasxx/G-Earth")); link_g_gearth.setTooltip(new Tooltip("https://github.com/sirjonasxx/G-Earth"));

View File

@ -107,21 +107,24 @@ public class InjectionController extends SubForm {
boolean dirty = false; boolean dirty = false;
lbl_corrruption.setText("isCorrupted: False"); lbl_corrruption.setText("isCorrupted: False");
lbl_corrruption.setFill(Paint.valueOf("Green")); lbl_corrruption.getStyleClass().clear();
lbl_corrruption.getStyleClass().add("not-corrupted-label");
HPacket[] packets = parsePackets(inputPacket.getText()); HPacket[] packets = parsePackets(inputPacket.getText());
if (packets.length == 0) { if (packets.length == 0) {
dirty = true; dirty = true;
lbl_corrruption.setFill(Paint.valueOf("#ee0404b2")); lbl_corrruption.setFill(Paint.valueOf("#ee0404b2"));
lbl_corrruption.setText("isCorrupted: True"); lbl_corrruption.getStyleClass().clear();
lbl_corrruption.getStyleClass().add("corrupted-label");
} }
for (int i = 0; i < packets.length; i++) { for (int i = 0; i < packets.length; i++) {
if (packets[i].isCorrupted()) { if (packets[i].isCorrupted()) {
if (!dirty) { if (!dirty) {
lbl_corrruption.setText("isCorrupted: True -> " + i); lbl_corrruption.setText("isCorrupted: True -> " + i);
lbl_corrruption.setFill(Paint.valueOf("#ee0404b2")); lbl_corrruption.getStyleClass().clear();
lbl_corrruption.getStyleClass().add("corrupted-label");
dirty = true; dirty = true;
} else } else
lbl_corrruption.setText(lbl_corrruption.getText() + ", " + i); lbl_corrruption.setText(lbl_corrruption.getText() + ", " + i);

View File

@ -1,6 +1,10 @@
.root { #main-window {
-fx-body-color : #F5F5F5; -fx-body-color : transparent;
-fx-background-radius: 15;
-fx-outer-border : #cecece; -fx-outer-border : #cecece;
-fx-border-color: #cecece;
-fx-border-radius: 11;
-fx-border-width: 0 1 1 1;
} }
.button,.menu-button,.toggle-button,.split-menu-button { .button,.menu-button,.toggle-button,.split-menu-button {
-fx-font-size: 14; -fx-font-size: 14;
@ -910,3 +914,75 @@ VBox > .split-menu-button.last > .arrow-button {
.connectedExtension { .connectedExtension {
-fx-background-color: #FFFFFF; -fx-background-color: #FFFFFF;
} }
#title-bar {
-fx-background-color: #f4f4f4;
-fx-background-radius: 10 10 0 0;
}
#close-button {
-fx-image: url("../../ui/titlebar/files/closeButton.png");
}
#close-button:hover {
-fx-image: url("../../ui/titlebar/files/closeButtonHover.png");
}
#close-button:pressed {
-fx-image: url("../../ui/titlebar/files/closeButtonPressed.png");
}
#minimize-button {
-fx-image: url("../../ui/titlebar/files/minimizeButton.png");
}
#minimize-button:hover {
-fx-image: url("../../ui/titlebar/files/minimizeButtonHover.png");
}
#minimize-button:pressed {
-fx-image: url("../../ui/titlebar/files/minimizeButtonPressed.png");
}
#main-tab-pane, #main-tab-pane > * {
-fx-background-radius: 0 0 10 10;
}
#icon {
-fx-image: url("./logoSmall.png");
}
#theme-button {
-fx-image: url("./themeButton.png");
}
.corrupted-label {
-fx-fill: #ee0404b2;
}
.not-corrupted-label {
-fx-fill: green;
}
.label {
-fx-text-fill: black;
}
.list-view {
-fx-border-color: #cccccc;
-fx-border-radius: 4;
-fx-background-color: #ffffff;
-fx-background-radius: 4;
}
.list-cell {
-fx-background-color: transparent;
}
.list-cell:even {
-fx-background-color: rgba(140, 140, 140, 0.1);
}
.scroll-pane {
-fx-background-color: white;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 569 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@ -1,7 +1,12 @@
.root { #main-window {
-fx-body-color : #F5F5F5; -fx-body-color : transparent;
-fx-background-radius: 15;
-fx-outer-border : #cecece; -fx-outer-border : #cecece;
-fx-border-color: orange;
-fx-border-radius: 11;
-fx-border-width: 0 1 1 1;
} }
.button,.menu-button,.toggle-button,.split-menu-button { .button,.menu-button,.toggle-button,.split-menu-button {
-fx-font-size: 14; -fx-font-size: 14;
-fx-background-radius: 4; -fx-background-radius: 4;
@ -9,6 +14,7 @@
-fx-pref-height: 30; -fx-pref-height: 30;
-fx-min-width: 30; -fx-min-width: 30;
} }
.button,.menu-button,.split-menu-button,.toggle-button,.number-button { .button,.menu-button,.split-menu-button,.toggle-button,.number-button {
-fx-background-insets: 0, 0, -1, 0; -fx-background-insets: 0, 0, -1, 0;
} }
@ -908,3 +914,75 @@ VBox > .split-menu-button.last > .arrow-button {
.connectedExtension { .connectedExtension {
-fx-background-color: #FFFFFF; -fx-background-color: #FFFFFF;
} }
#title-bar {
-fx-background-color: #f4f4f4;
-fx-background-radius: 10 10 0 0;
}
#close-button {
-fx-image: url("../../ui/titlebar/files/closeButton.png");
}
#close-button:hover {
-fx-image: url("../../ui/titlebar/files/closeButtonHover.png");
}
#close-button:pressed {
-fx-image: url("../../ui/titlebar/files/closeButtonPressed.png");
}
#minimize-button {
-fx-image: url("../../ui/titlebar/files/minimizeButton.png");
}
#minimize-button:hover {
-fx-image: url("../../ui/titlebar/files/minimizeButtonHover.png");
}
#minimize-button:pressed {
-fx-image: url("../../ui/titlebar/files/minimizeButtonPressed.png");
}
#main-tab-pane, #main-tab-pane > * {
-fx-background-radius: 0 0 10 10;
}
#icon {
-fx-image: url("./logoSmall.png");
}
#theme-button {
-fx-image: url("./themeButton.png");
}
.corrupted-label {
-fx-fill: #ee0404b2;
}
.not-corrupted-label {
-fx-fill: green;
}
.label {
-fx-text-fill: black;
}
.list-view {
-fx-border-color: #cccccc;
-fx-border-radius: 4;
-fx-background-color: #ffffff;
-fx-background-radius: 4;
}
.list-cell {
-fx-background-color: transparent;
}
.list-cell:even {
-fx-background-color: rgba(140, 140, 140, 0.1);
}
.scroll-pane {
-fx-background-color: white;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@ -1,17 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Tab?> <?import javafx.geometry.*?>
<?import javafx.scene.control.TabPane?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.Pane?> <?import javafx.scene.image.*?>
<?import javafx.scene.layout.VBox?> <?import javafx.scene.layout.*?>
<!--maxHeight="19.0" minHeight="19.0"--> <!--maxHeight="19.0" minHeight="19.0"-->
<VBox xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml/1" <VBox id="main-window" prefWidth="650.0" xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml/1" fx:controller="gearth.ui.GEarthController">
fx:controller="gearth.ui.GEarthController"> <Pane id="title-bar" fx:id="titleBar" maxHeight="25.0" onMouseDragged="#handleMovementAction" onMousePressed="#handleClickAction" prefHeight="25.0" prefWidth="200.0">
<Pane fx:id="mover" maxHeight="0.0" minHeight="0.0" prefWidth="200.0"/> <children>
<TabPane fx:id="tabBar" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" <ImageView id="close-button" fitHeight="25.0" fitWidth="50.0" layoutX="601.0" onMouseClicked="#handleCloseAction" onTouchPressed="#handleCloseAction" pickOnBounds="true" preserveRatio="true">
minWidth="-Infinity" prefHeight="295.0" prefWidth="650.0" tabClosingPolicy="UNAVAILABLE"> <image>
<Image url="@titlebar/files/closeButton.png" />
</image>
</ImageView>
<ImageView id="minimize-button" fitHeight="25.0" fitWidth="50.0" layoutX="551.0" onMouseClicked="#handleMinimizeAction" onTouchPressed="#handleMinimizeAction" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@titlebar/files/minimizeButton.png" />
</image>
</ImageView>
<ImageView id="icon" fitHeight="16.0" fitWidth="16.0" layoutX="7.0" layoutY="5.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../themes/G-Earth/logoSmall.png" />
</image>
</ImageView>
<Label fx:id="titleLabel" layoutX="23.0" layoutY="5.0" text="G-Earth 1.5.1">
<padding>
<Insets left="2.0" />
</padding>
</Label>
<ImageView id="theme-button" fitHeight="20.0" fitWidth="38.0" layoutX="505.0" layoutY="3.0" onMouseClicked="#toggleTheme" onTouchPressed="#toggleTheme" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../themes/G-Earth/themeButton.png" />
</image></ImageView>
</children></Pane>
<TabPane id="main-tab-pane" fx:id="tabBar" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" prefHeight="295.0" prefWidth="650.0" tabClosingPolicy="UNAVAILABLE">
<Tab text="Connection"> <Tab text="Connection">
<fx:include fx:id="connection" source="connection/Connection.fxml" /> <fx:include fx:id="connection" source="connection/Connection.fxml" />
</Tab> </Tab>

View File

@ -5,7 +5,7 @@
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?> <?import javafx.scene.text.*?>
<GridPane alignment="CENTER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="258.0" prefWidth="650.0" xmlns="http://javafx.com/javafx/11.0.2" xmlns:fx="http://javafx.com/fxml/1" fx:controller="gearth.ui.connection.ConnectionController"> <GridPane alignment="CENTER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="258.0" prefWidth="650.0" xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml/1" fx:controller="gearth.ui.connection.ConnectionController">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints> </columnConstraints>

View File

@ -12,12 +12,12 @@
<RowConstraints maxHeight="227.0" minHeight="10.0" prefHeight="222.0" vgrow="SOMETIMES" /> <RowConstraints maxHeight="227.0" minHeight="10.0" prefHeight="222.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="185.0" minHeight="10.0" prefHeight="40.0" vgrow="SOMETIMES" /> <RowConstraints maxHeight="185.0" minHeight="10.0" prefHeight="40.0" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<ScrollPane fx:id="scroller" hbarPolicy="NEVER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" style="-fx-border-color: #888888; -fx-background: #FFFFFF; -fx-border-radius: 4px;" vbarPolicy="ALWAYS"> <ScrollPane fx:id="scroller" hbarPolicy="NEVER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" style="-fx-border-color: #888888; -fx-background: transparent; -fx-border-radius: 4px;" styleClass="table-header" vbarPolicy="ALWAYS">
<GridPane.margin> <GridPane.margin>
<Insets bottom="8.0" left="17.0" right="17.0" top="17.0" /> <Insets bottom="8.0" left="17.0" right="17.0" top="17.0" />
</GridPane.margin> </GridPane.margin>
<VBox fx:id="extensioncontainer" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308"> <VBox fx:id="extensioncontainer" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308">
<GridPane fx:id="header_ext" gridLinesVisible="true"> <GridPane fx:id="header_ext" gridLinesVisible="true" styleClass="table-header">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="22.0" prefWidth="132.0" /> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="22.0" prefWidth="132.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="34.0" prefWidth="204.0" /> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="34.0" prefWidth="204.0" />

View File

@ -37,12 +37,12 @@
<GridPane.margin> <GridPane.margin>
<Insets left="13.0" right="13.0" top="4.0" /> <Insets left="13.0" right="13.0" top="4.0" />
</GridPane.margin> </GridPane.margin>
<Text fx:id="lbl_corrruption" fill="#ee0404b2" strokeType="OUTSIDE" strokeWidth="0.0" text="isCorrupted: True"> <Text fx:id="lbl_corrruption" styleClass="corrupted-label" strokeType="OUTSIDE" strokeWidth="0.0" text="isCorrupted: True">
<font> <font>
<Font name="System Italic" size="11.0" /> <Font name="System Italic" size="11.0" />
</font> </font>
</Text> </Text>
<Text fx:id="lbl_pcktInfo" fill="#000000b2" nodeOrientation="LEFT_TO_RIGHT" strokeType="OUTSIDE" strokeWidth="0.0" text="header (id:NULL, length:0)" GridPane.columnIndex="1" GridPane.halignment="RIGHT"> <Text fx:id="lbl_pcktInfo" fill="#000000b2" styleClass="pckt-info" nodeOrientation="LEFT_TO_RIGHT" strokeType="OUTSIDE" strokeWidth="0.0" text="header (id:NULL, length:0)" GridPane.columnIndex="1" GridPane.halignment="RIGHT">
<font> <font>
<Font name="System Italic" size="11.0" /> <Font name="System Italic" size="11.0" />
</font> </font>

View File

@ -17,7 +17,7 @@
<Insets bottom="8.0" left="17.0" right="17.0" top="17.0" /> <Insets bottom="8.0" left="17.0" right="17.0" top="17.0" />
</GridPane.margin> </GridPane.margin>
<VBox fx:id="schedulecontainer" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308"> <VBox fx:id="schedulecontainer" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308">
<GridPane fx:id="header" gridLinesVisible="true"> <GridPane fx:id="header" gridLinesVisible="true" styleClass="table-header">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="163.0" minWidth="10.0" percentWidth="10.0" prefWidth="57.0" /> <ColumnConstraints hgrow="SOMETIMES" maxWidth="163.0" minWidth="10.0" percentWidth="10.0" prefWidth="57.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="190.0" minWidth="10.0" percentWidth="39.0" prefWidth="189.0" /> <ColumnConstraints hgrow="SOMETIMES" maxWidth="190.0" minWidth="10.0" percentWidth="39.0" prefWidth="189.0" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 662 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB