mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-29 19:50:51 +01:00
stuff
This commit is contained in:
parent
767fb1ab9b
commit
f4ee6f00c8
@ -19,13 +19,12 @@ import javafx.stage.StageStyle;
|
||||
|
||||
public class GEarth extends Application {
|
||||
|
||||
public static Application main;
|
||||
public static GEarth main;
|
||||
public static String version = "1.5.1";
|
||||
public static String gitApi = "https://api.github.com/repos/sirjonasxx/G-Earth/releases/latest";
|
||||
public static Theme theme;
|
||||
|
||||
private Stage stage;
|
||||
private TitleBarController titleBar;
|
||||
private GEarthController controller;
|
||||
|
||||
static {
|
||||
@ -49,7 +48,7 @@ public class GEarth extends Application {
|
||||
stage.initStyle(StageStyle.TRANSPARENT);
|
||||
|
||||
primaryStage.setScene(new Scene(root));
|
||||
titleBar = TitleBarController.create(primaryStage, new TitleBarConfig() {
|
||||
TitleBarController.create(primaryStage, new TitleBarConfig() {
|
||||
@Override
|
||||
public boolean displayThemePicker() {
|
||||
return true;
|
||||
|
@ -1,13 +1,18 @@
|
||||
package gearth.misc;
|
||||
|
||||
import gearth.GEarth;
|
||||
import gearth.ui.titlebar.DefaultTitleBarConfig;
|
||||
import gearth.ui.titlebar.TitleBarController;
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.InvalidationListener;
|
||||
import javafx.beans.Observable;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.ButtonType;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.util.prefs.Preferences;
|
||||
|
||||
@ -48,11 +53,33 @@ public class AdminValidator {
|
||||
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);
|
||||
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
|
||||
stage.getIcons().add(new Image(GEarth.class.getResourceAsStream(String.format("/gearth/ui/themes/%s/logoSmall.png", GEarth.theme))));
|
||||
stage.getScene().getStylesheets().add(GEarth.class.getResource(String.format("/gearth/ui/themes/%s/styling.css", GEarth.theme)).toExternalForm());
|
||||
alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
|
||||
alert.setResizable(false);
|
||||
alert.show();
|
||||
stage.getIcons().add(new Image(GEarth.class.getResourceAsStream("/gearth/ui/themes/G-Earth/logoSmall.png")));
|
||||
stage.getScene().getStylesheets().add(GEarth.class.getResource(String.format("/gearth/ui/themes/%s/styling.css", GEarth.theme.internalName())).toExternalForm());
|
||||
// try {
|
||||
// TitleBarController.create(stage, new DefaultTitleBarConfig(stage));
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// alert.getDialogPane().setMaxHeight(-1);
|
||||
// alert.getDialogPane().setMinHeight(200);
|
||||
// alert.getDialogPane()
|
||||
//
|
||||
//
|
||||
// boolean[] once = new boolean[]{false};
|
||||
// stage.heightProperty().addListener(observable -> {
|
||||
// if (!once[0]) {
|
||||
// once[0] = true;
|
||||
// stage.setMinHeight(alert.getDialogPane().getHeight() + 25);
|
||||
// stage.setHeight(alert.getDialogPane().getHeight() + 25);
|
||||
// stage.setMaxHeight(alert.getDialogPane().getHeight() + 25);
|
||||
// }
|
||||
//
|
||||
// });
|
||||
|
||||
// stage.setHeight(stage.getHeight() + 25);
|
||||
// stage.setResizable(false);
|
||||
// stage.sizeToScene();x
|
||||
stage.show();
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -26,8 +26,8 @@ public class GExtensionStoreLauncher extends InternalExtensionFormLauncher<GExte
|
||||
stage.setHeight(530);
|
||||
|
||||
stage.setScene(new Scene(root));
|
||||
stage.getScene().getStylesheets().add(GEarthController.class.getResource(String.format("/gearth/ui/themes/%s/styling.css", GEarth.theme)).toExternalForm());
|
||||
stage.getIcons().add(new Image(GEarth.class.getResourceAsStream(String.format("/gearth/ui/themes/%s/logoSmall.png", GEarth.theme))));
|
||||
stage.getScene().getStylesheets().add(GEarthController.class.getResource("/gearth/ui/themes/G-Earth/styling.css").toExternalForm());
|
||||
stage.getIcons().add(new Image(GEarth.class.getResourceAsStream("/gearth/ui/themes/G-Earth/logoSmall.png")));
|
||||
|
||||
GExtensionStore gExtensionStore = new GExtensionStore();
|
||||
|
||||
|
@ -17,12 +17,12 @@ public class UiLoggerLauncher extends InternalExtensionFormLauncher<UiLogger> {
|
||||
FXMLLoader loader = new FXMLLoader(UiLogger.class.getResource("UiLogger.fxml"));
|
||||
|
||||
Parent root = loader.load();
|
||||
stage.setTitle(String.format("%s | Packet Logger", GEarth.theme));
|
||||
stage.setTitle("G-Earth | Packet Logger");
|
||||
stage.initModality(Modality.NONE);
|
||||
stage.getIcons().add(new Image(getClass().getResourceAsStream(String.format("/gearth/ui/themes/%s/logoSmall.png", GEarth.theme))));
|
||||
stage.getIcons().add(new Image(getClass().getResourceAsStream("/gearth/ui/themes/G-Earth/logoSmall.png")));
|
||||
|
||||
Scene scene = new Scene(root);
|
||||
scene.getStylesheets().add(String.format("/gearth/ui/themes/%s/styling.css", GEarth.theme));
|
||||
scene.getStylesheets().add("/gearth/ui/themes/G-Earth/styling.css");
|
||||
scene.getStylesheets().add("/gearth/services/internal_extensions/uilogger/logger.css");
|
||||
|
||||
UiLoggerController controller = loader.getController();
|
||||
|
@ -49,7 +49,7 @@ public class ExtensionLogger {
|
||||
controller.setStage(stage);
|
||||
|
||||
stage.setScene(scene);
|
||||
TitleBarController titleBar = TitleBarController.create(stage, new DefaultTitleBarConfig(stage) {
|
||||
TitleBarController.create(stage, new DefaultTitleBarConfig(stage) {
|
||||
@Override
|
||||
public void onCloseClicked() {
|
||||
stage.hide();
|
||||
|
@ -27,7 +27,7 @@ public class DefaultTitleBarConfig implements TitleBarConfig {
|
||||
|
||||
@Override
|
||||
public void onCloseClicked() {
|
||||
|
||||
stage.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -57,7 +57,7 @@
|
||||
.info > .label,
|
||||
.warning > .label,
|
||||
.danger > .label {
|
||||
-fx-text-fill: white;
|
||||
-fx-text-fill: black;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
@ -689,7 +689,7 @@ VBox > .split-menu-button.last > .arrow-button {
|
||||
}
|
||||
|
||||
.titled-pane.primary {
|
||||
-fx-text-fill: white;
|
||||
-fx-text-fill: black;
|
||||
}
|
||||
|
||||
.titled-pane.primary > .title {
|
||||
|
@ -59,7 +59,7 @@
|
||||
.info > .label,
|
||||
.warning > .label,
|
||||
.danger > .label {
|
||||
-fx-text-fill: white;
|
||||
-fx-text-fill: black;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
@ -691,7 +691,7 @@ VBox > .split-menu-button.last > .arrow-button {
|
||||
}
|
||||
|
||||
.titled-pane.primary {
|
||||
-fx-text-fill: white;
|
||||
-fx-text-fill: black;
|
||||
}
|
||||
|
||||
.titled-pane.primary > .title {
|
||||
|
Loading…
Reference in New Issue
Block a user