From 0b6e2bdc0ec2d7e0252c00dacb1fe5170404ab20 Mon Sep 17 00:00:00 2001 From: Dominik Gruntz Date: Sun, 5 Aug 2018 12:37:47 +0200 Subject: [PATCH 1/2] Changes pseudo.css The code defines the used customRegion to be of type "my", therefore this type should be used in the css file. Otherweise, the line customRegion.getStyleClass().add("my"); could be deleted. As an alternative, both declarations could be shown by defining .my:active{ -fx-background-color: red; -fx-opacity: 1; } CustomRegion:active{ -fx-background-color: blue; -fx-opacity: 1; } If the "my" style is not assigned, then the color changes to blue. --- .../src/main/resources/de/javafxbuch/pseudo.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Kapitel 7/7.2/css-pseudoclass/src/main/resources/de/javafxbuch/pseudo.css b/Kapitel 7/7.2/css-pseudoclass/src/main/resources/de/javafxbuch/pseudo.css index ae83f46..61925a7 100644 --- a/Kapitel 7/7.2/css-pseudoclass/src/main/resources/de/javafxbuch/pseudo.css +++ b/Kapitel 7/7.2/css-pseudoclass/src/main/resources/de/javafxbuch/pseudo.css @@ -1,5 +1,4 @@ -CustomRegion:active{ +.my:active{ -fx-background-color: red; -fx-opacity: 1; } - From fe4f2d6d5bec27f660ca02cf32d4b1d8c187475f Mon Sep 17 00:00:00 2001 From: Dominik Gruntz Date: Sun, 5 Aug 2018 15:05:30 +0200 Subject: [PATCH 2/2] Changes the padding-style of labels as printed in the book In the book, the padding of the label is definid as -fx-padding: 4 4 0 4; --- .../src/main/resources/de/javafxbuch/calculator.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kapitel 7/7.1/fxml-calculator-css/src/main/resources/de/javafxbuch/calculator.css b/Kapitel 7/7.1/fxml-calculator-css/src/main/resources/de/javafxbuch/calculator.css index 4ff4f1a..7f2503b 100644 --- a/Kapitel 7/7.1/fxml-calculator-css/src/main/resources/de/javafxbuch/calculator.css +++ b/Kapitel 7/7.1/fxml-calculator-css/src/main/resources/de/javafxbuch/calculator.css @@ -6,7 +6,7 @@ GridPane{ -fx-background-color: white; -fx-alignment: CENTER_RIGHT; -fx-font-size: 50; - -fx-padding: 4 4 4 4; + -fx-padding: 4 4 0 4; } .button{