From 292b0ae7565e0907e54f10c722fd01ec56ace57c Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Sat, 29 Oct 2016 19:59:06 +0200 Subject: [PATCH 1/5] No style --- src/sample/Main.java | 5 +++-- src/sample/sample.fxml | 8 +------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/sample/Main.java b/src/sample/Main.java index 25c334b..cf8dbfa 100644 --- a/src/sample/Main.java +++ b/src/sample/Main.java @@ -5,16 +5,17 @@ import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; +import javafx.stage.StageStyle; public class Main extends Application { @Override public void start(Stage primaryStage) throws Exception{ + primaryStage.initStyle(StageStyle.UNDECORATED); Parent root = FXMLLoader.load(getClass().getResource("sample.fxml")); primaryStage.setTitle("Hello World"); - primaryStage.setScene(new Scene(root, 300, 275)); + primaryStage.setScene(new Scene(root, 400, 400)); primaryStage.show(); - //Dankerino } diff --git a/src/sample/sample.fxml b/src/sample/sample.fxml index a8517fa..5290677 100644 --- a/src/sample/sample.fxml +++ b/src/sample/sample.fxml @@ -1,11 +1,5 @@ - - - - - - - + \ No newline at end of file From fc813e1a654e729532b5e54054b8d58f837e2858 Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Sat, 29 Oct 2016 20:00:57 +0200 Subject: [PATCH 2/5] No style --- src/sample/sample.fxml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sample/sample.fxml b/src/sample/sample.fxml index 5290677..e48887f 100644 --- a/src/sample/sample.fxml +++ b/src/sample/sample.fxml @@ -2,4 +2,5 @@ - \ No newline at end of file + + From 2039f2b9acdad49b1872de3590b75cbd9e7d4997 Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Sat, 29 Oct 2016 20:16:27 +0200 Subject: [PATCH 3/5] Adds style and crappy exit button --- src/assets/nav.css | 3 +++ src/sample/Main.java | 2 ++ src/sample/sample.fxml | 8 ++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 src/assets/nav.css diff --git a/src/assets/nav.css b/src/assets/nav.css new file mode 100644 index 0000000..bbd6918 --- /dev/null +++ b/src/assets/nav.css @@ -0,0 +1,3 @@ +#exit{ + -fx-background-color: rgba(255, 0, 255, 0.5); +} \ No newline at end of file diff --git a/src/sample/Main.java b/src/sample/Main.java index cf8dbfa..a3f1143 100644 --- a/src/sample/Main.java +++ b/src/sample/Main.java @@ -16,6 +16,8 @@ public class Main extends Application { primaryStage.setTitle("Hello World"); primaryStage.setScene(new Scene(root, 400, 400)); primaryStage.show(); + + root.lookup("#exit").setOnMouseClicked(event -> primaryStage.close()); // Close program if button is clicked } diff --git a/src/sample/sample.fxml b/src/sample/sample.fxml index e48887f..4aa3517 100644 --- a/src/sample/sample.fxml +++ b/src/sample/sample.fxml @@ -1,6 +1,10 @@ + - - + + +