From a6b1ce7f728503bec0ffb62406e4be29a215f45c Mon Sep 17 00:00:00 2001 From: Seil0 Date: Sun, 23 Jun 2019 15:39:58 +0200 Subject: [PATCH] some new css styling --- .../java/com/cemu_UI/application/Main.java | 15 +- .../application/MainWindowController.java | 2 +- src/main/resources/css/MainWindows.css | 130 ++++++++++++++++-- src/main/resources/fxml/MainWindow.fxml | 74 +++++----- 4 files changed, 163 insertions(+), 58 deletions(-) diff --git a/src/main/java/com/cemu_UI/application/Main.java b/src/main/java/com/cemu_UI/application/Main.java index cac5b4c..c704425 100644 --- a/src/main/java/com/cemu_UI/application/Main.java +++ b/src/main/java/com/cemu_UI/application/Main.java @@ -35,6 +35,7 @@ import org.apache.logging.log4j.Logger; import com.cemu_UI.controller.CloudController; import com.cemu_UI.controller.XMLController; +import com.cemu_UI.uiElements.JFXInfoAlert; import com.cemu_UI.uiElements.JFXOkayCancelAlert; import javafx.application.Application; @@ -86,11 +87,11 @@ public class Main extends Application { loader.setLocation(getClass().getResource("/fxml/MainWindow.fxml")); loader.setController(mainWindowController); pane = (AnchorPane) loader.load(); - primaryStage.setMinWidth(265.00); - primaryStage.setMinHeight(425.00); + primaryStage.setMinWidth(1130); + primaryStage.setMinHeight(600 + 34); primaryStage.setTitle("cemu_UI"); // primaryStage.getIcons().add(new Image(Main.class.getResourceAsStream(""))); //adds application icon - primaryStage.setOnCloseRequest(event -> System.exit(1)); + primaryStage.setOnCloseRequest(event -> System.exit(0)); // generate window scene = new Scene(pane); // create new scene, append pane to scene @@ -105,11 +106,11 @@ public class Main extends Application { if (Main.class.getResourceAsStream("/client_secret.json") == null) { LOGGER.error("client_secret is missing!!!!!"); - JFXOkayCancelAlert noCSAlert = new JFXOkayCancelAlert("Error", - "client_secret is missing! Please contact the maintainer. \nIf you compiled cemu_UI by yourself see: \nhttps://git.mosad.xyz/Seil0/cemu_UI/wiki/Documantation", + JFXInfoAlert noCSAlert = new JFXInfoAlert("Error", + "client_secret is missing! Please contact the maintainer. \n" + + "If you compiled cemu_UI by yourself see: \n" + + "https://git.mosad.xyz/Seil0/cemu_UI/wiki/Documantation", "-fx-button-type: RAISED; -fx-background-color: #00a8cc; -fx-text-fill: BLACK;", primaryStage); - noCSAlert.setOkayAction(e -> {}); - noCSAlert.setCancelAction(e -> {}); noCSAlert.showAndWait(); } diff --git a/src/main/java/com/cemu_UI/application/MainWindowController.java b/src/main/java/com/cemu_UI/application/MainWindowController.java index 77bec6d..f9185c0 100644 --- a/src/main/java/com/cemu_UI/application/MainWindowController.java +++ b/src/main/java/com/cemu_UI/application/MainWindowController.java @@ -1025,7 +1025,7 @@ public class MainWindowController { menuTrue = false; } }); - } + } /** * reload all ROMs from the ROM directory diff --git a/src/main/resources/css/MainWindows.css b/src/main/resources/css/MainWindows.css index 2712b11..ce0a87c 100644 --- a/src/main/resources/css/MainWindows.css +++ b/src/main/resources/css/MainWindows.css @@ -1,6 +1,8 @@ -/* - * HAMBURGER CSS - */ +/******************************************************************************* + * * + * Hamburger Menu * + * * + ******************************************************************************/ .jfx-hamburgerW StackPane { -fx-background-color: white; @@ -12,9 +14,11 @@ -fx-background-radius: 5px; } -/* - * TREE TABLE CSS - */ +/******************************************************************************* + * * + * TreeTable * + * * + ******************************************************************************/ .tree-table-view { -fx-tree-table-color: rgba(0, 168, 204, 0.2); @@ -84,10 +88,11 @@ -fx-padding: 1; /* 0.083333em; */ } -/* - * ChoiceBox - */ - +/******************************************************************************* + * * + * ChoiceBox * + * * + ******************************************************************************/ .choice-box { -fx-background-color: transparent; @@ -109,10 +114,109 @@ -fx-background-color: #00A8CC; } -/* - * Spinner - */ +/******************************************************************************* + * * + * Spinner * + * * + ******************************************************************************/ + .spinner { -fx-background-color: #f4f4f4; } +/******************************************************************************* + * * + * ScrollBar * + * * + ******************************************************************************/ + + .scroll-bar:vertical, .scroll-bar:horizontal { + -fx-background-color: transparent; + } + +.scroll-bar:vertical > .track-background, .scroll-bar:horizontal > .track-background { + -fx-background-color: transparent; + -fx-background-insets: 0.0; +} + +.scroll-bar:vertical > .thumb { + -fx-background-color: #BCBCBC; + -fx-background-insets: 0.0; + -fx-background-radius: 15.0; +} + +.scroll-bar:horizontal > .thumb { + -fx-background-color: #FFFFFF; + -fx-background-insets: 0.0; + -fx-background-radius: 15.0; +} + +/* Up- and Down-Button Padding */ +.scroll-bar:vertical > .increment-button, .scroll-bar:vertical > .decrement-button { + -fx-padding: 5 2 5 2; +} + +/* Left- and Right-Button Padding */ +.scroll-bar:horizontal > .increment-button, .scroll-bar:horizontal > .decrement-button { + -fx-background-color: transparent; + -fx-padding: 5 2 5 2; +} + +.scroll-bar > .increment-button, .scroll-bar > .decrement-button, .scroll-bar:hover > .increment-button, .scroll-bar:hover > .decrement-button { + -fx-background-color: transparent; +} + +.scroll-bar > .increment-button > .increment-arrow, .scroll-bar > .decrement-button > .decrement-arrow { + -fx-background-color: rgb(150.0, 150.0, 150.0); +} + +/* Up Arrow */ +.scroll-bar:vertical > .increment-button > .increment-arrow { + -fx-shape: "M298 426h428l-214 214z"; +} + +/* Down Arrow */ +.scroll-bar:vertical > .decrement-button > .decrement-arrow { + -fx-shape: "M298 598l214-214 214 214h-428z"; +} + +/* Right Arrow */ +.scroll-bar:horizontal > .increment-button > .increment-arrow { + /* -fx-shape: "M0 428l0 -428l214 214l-214 214z"; */ + -fx-background-color:transparent; + -fx-shape: " "; + -fx-padding: 0; +} + +/* Left Arrow */ +.scroll-bar:horizontal > .decrement-button > .decrement-arrow { + /* -fx-shape: "M214 0l0 428l-214 -214l214 -214z"; */ + -fx-background-color:transparent; + -fx-shape: " "; + -fx-padding: 0; +} + +/******************************************************************************* + * * + * ScrollPane * + * * + ******************************************************************************/ + +.scroll-pane { + -fx-background-insets: 0; + -fx-padding: 0; +} + +.scroll-pane:focused { + -fx-background-insets: 0; +} + +.scroll-pane .corner { + -fx-background-insets: 0; +} + +.scroll-pane > .viewport { + -fx-background-color: transparent; +} + + diff --git a/src/main/resources/fxml/MainWindow.fxml b/src/main/resources/fxml/MainWindow.fxml index 8d87df3..a9d22a1 100644 --- a/src/main/resources/fxml/MainWindow.fxml +++ b/src/main/resources/fxml/MainWindow.fxml @@ -19,7 +19,7 @@ - + @@ -30,41 +30,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -73,7 +39,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +