diff --git a/visualiser/src/main/java/seng302/App.java b/visualiser/src/main/java/seng302/App.java index a003c681..05e25566 100644 --- a/visualiser/src/main/java/seng302/App.java +++ b/visualiser/src/main/java/seng302/App.java @@ -6,6 +6,7 @@ import javafx.event.EventHandler; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; +import javafx.scene.image.Image; import javafx.stage.Stage; import javafx.stage.WindowEvent; @@ -31,8 +32,11 @@ public class App extends Application { FXMLLoader loader = new FXMLLoader(getClass().getResource("/scenes/main.fxml")); Parent root = loader.load(); Scene scene = new Scene(root, 1200, 800); + scene.getStylesheets().add("/css/sail.css"); + stage.setScene(scene); stage.setTitle("RaceVision - Team 7"); + stage.getIcons().add(new Image(getClass().getClassLoader().getResourceAsStream("images/SailIcon.png"))); stage.show(); } } diff --git a/visualiser/src/main/resources/css/sail.css b/visualiser/src/main/resources/css/sail.css new file mode 100644 index 00000000..efba1ac1 --- /dev/null +++ b/visualiser/src/main/resources/css/sail.css @@ -0,0 +1,53 @@ +.root { + -fx-base: rgb(212, 26, 32); + -fx-background: rgb(50, 50, 50); + + /* make controls (buttons, thumb, etc.) slightly lighter */ + -fx-color: derive(-fx-base, 10%); + + /* text fields and table rows background */ + -fx-control-inner-background: rgb(50, 50, 50); + /* version of -fx-control-inner-background for alternative rows */ + -fx-control-inner-background-alt: derive(-fx-control-inner-background, 2.5%); + + /* text colors depending on background's brightness */ + -fx-light-text-color: rgb(220, 220, 220); + -fx-mid-text-color: rgb(100, 100, 100); + -fx-dark-text-color: rgb(20, 20, 20); + + /*highlighting/accenting objects. */ + -fx-accent: rgb(220, 220, 220); + + /* color of non-focused yet selected elements */ + -fx-selection-bar-non-focused: rgb(50, 50, 50); + + /*Focus colour*/ + -fx-focus-color: rgb(255, 255, 255); +} + +/* Fix derived prompt color for text fields */ +.text-input { + -fx-prompt-text-fill: derive(-fx-control-inner-background, +50%); + +} + +/* Keep prompt invisible when focused (above color fix overrides it) */ +.text-input:focused { + -fx-prompt-text-fill: transparent; +} + +/* Fix scroll bar buttons arrows colors */ +.scroll-bar > .increment-button > .increment-arrow, +.scroll-bar > .decrement-button > .decrement-arrow { + -fx-background-color: -fx-mark-highlight-color, rgb(255, 255, 255); +} + +.scroll-bar > .increment-button:hover > .increment-arrow, +.scroll-bar > .decrement-button:hover > .decrement-arrow { + -fx-background-color: -fx-mark-highlight-color, rgb(240, 240, 240); +} + +.scroll-bar > .increment-button:pressed > .increment-arrow, +.scroll-bar > .decrement-button:pressed > .decrement-arrow { + -fx-background-color: -fx-mark-highlight-color, rgb(255, 255, 255); +} \ No newline at end of file diff --git a/visualiser/src/main/resources/css/test.css b/visualiser/src/main/resources/css/test.css new file mode 100644 index 00000000..dce66101 --- /dev/null +++ b/visualiser/src/main/resources/css/test.css @@ -0,0 +1,57 @@ +/* + * This is an adjustment of the original modena.css for a consistent dark theme. + * Original modena.css here: https://gist.github.com/maxd/63691840fc372f22f470. + * This one from: https://github.com/joffrey-bion/javafx-themes/blob/master/css/modena_dark.css + */ + +/* Redefine base colors */ +.root { + -fx-base: rgb(50, 50, 50); + -fx-background: rgb(50, 50, 50); + + /* make controls (buttons, thumb, etc.) slightly lighter */ + -fx-color: derive(-fx-base, 10%); + + /* text fields and table rows background */ + -fx-control-inner-background: rgb(20, 20, 20); + /* version of -fx-control-inner-background for alternative rows */ + -fx-control-inner-background-alt: derive(-fx-control-inner-background, 2.5%); + + /* text colors depending on background's brightness */ + -fx-light-text-color: rgb(220, 220, 220); + -fx-mid-text-color: rgb(100, 100, 100); + -fx-dark-text-color: rgb(20, 20, 20); + + /* A bright blue for highlighting/accenting objects. For example: selected + * text; selected items in menus, lists, trees, and tables; progress bars */ + -fx-accent: rgb(0, 80, 100); + + /* color of non-focused yet selected elements */ + -fx-selection-bar-non-focused: rgb(50, 50, 50); +} + +/* Fix derived prompt color for text fields */ +.text-input { + -fx-prompt-text-fill: derive(-fx-control-inner-background, +50%); +} + +/* Keep prompt invisible when focused (above color fix overrides it) */ +.text-input:focused { + -fx-prompt-text-fill: transparent; +} + +/* Fix scroll bar buttons arrows colors */ +.scroll-bar > .increment-button > .increment-arrow, +.scroll-bar > .decrement-button > .decrement-arrow { + -fx-background-color: -fx-mark-highlight-color, rgb(220, 220, 220); +} + +.scroll-bar > .increment-button:hover > .increment-arrow, +.scroll-bar > .decrement-button:hover > .decrement-arrow { + -fx-background-color: -fx-mark-highlight-color, rgb(240, 240, 240); +} + +.scroll-bar > .increment-button:pressed > .increment-arrow, +.scroll-bar > .decrement-button:pressed > .decrement-arrow { + -fx-background-color: -fx-mark-highlight-color, rgb(255, 255, 255); +} \ No newline at end of file diff --git a/visualiser/src/main/resources/images/SailIcon.png b/visualiser/src/main/resources/images/SailIcon.png new file mode 100644 index 00000000..1d4d25d1 Binary files /dev/null and b/visualiser/src/main/resources/images/SailIcon.png differ