The first time ColorPicker dialog is displayed all styles are correct in accordance with the Scene stylesheets. If however you change the stylesheets of the Scene afterwards and then display the dialog again it'll still show up with the initial style (before the change of stylesheets in the Scene).
This is because the CustomColorDialog is created the first time the user presses the link to show it:
customColorLink.setOnAction(new EventHandler<ActionEvent>() {
@Override public void handle(ActionEvent t) {
if (customColorDialog == null) {
customColorDialog = new CustomColorDialog(popupControl);
And in the constructor of the CustomColorDialog all stylesheets are copied:
if (ownerScene != null) {
if (ownerScene.getUserAgentStylesheet() != null) {
customScene.setUserAgentStylesheet(ownerScene.getUserAgentStylesheet());
}
customScene.getStylesheets().addAll(ownerScene.getStylesheets());
}
This happens the first time the Dialog is shown. After that the stylesheets are never updated again. Meaning they are still the ones that existed the first time the Dialog was shown.
This is because the CustomColorDialog is created the first time the user presses the link to show it:
customColorLink.setOnAction(new EventHandler<ActionEvent>() {
@Override public void handle(ActionEvent t) {
if (customColorDialog == null) {
customColorDialog = new CustomColorDialog(popupControl);
And in the constructor of the CustomColorDialog all stylesheets are copied:
if (ownerScene != null) {
if (ownerScene.getUserAgentStylesheet() != null) {
customScene.setUserAgentStylesheet(ownerScene.getUserAgentStylesheet());
}
customScene.getStylesheets().addAll(ownerScene.getStylesheets());
}
This happens the first time the Dialog is shown. After that the stylesheets are never updated again. Meaning they are still the ones that existed the first time the Dialog was shown.
- relates to
-
JDK-8322486 ColorPicker: blurry popup
-
- Open
-