mkpaz / atlantafx

Modern JavaFX CSS theme collection with additional controls.
https://mkpaz.github.io/atlantafx
MIT License
791 stars 64 forks source link

Popover does not take dark theme #64

Closed vdjurovic closed 1 year ago

vdjurovic commented 1 year ago

When using NordDark theme, popover does not use dark theme. It looks like background remains white, making text and controls look broken.

This is sample screenshot for dark theme: dark-theme-test

For light theme, it looks OK: light-theme-test

This is the sample code I used:

public class TestApp extends Application {

    @Override
    public void start(Stage stage) throws Exception {
        var bp = new BorderPane();
        var hbox = new HBox();
        hbox.getChildren().add(new Label("Label"));
        hbox.getChildren().add(new TextField());
        var popup = new PopOver(hbox);
        popup.setArrowLocation(PopOver.ArrowLocation.TOP_CENTER);
        var button = new Button("Click me");
        button.setOnAction(e -> popup.show(button));

        bp.setCenter(button);
        Application.setUserAgentStylesheet(new NordDark().getUserAgentStylesheet());
        stage.setTitle("Dark theme test");
        var scene = new Scene(bp, 600, 400.0);
        stage.setScene(scene);
        stage.show();
    }
}

Is there something I'm missing in this code? Because in sampler app this works fine. I'm running this on Kubuntu with Java 19 and JavaFX 19.0.2.1. In additon, this happens for all dark themes, not just NordDark.

mkpaz commented 1 year ago

I guess you're using ControlsFx because AtlantaFX control is Popover, not PopOver. Except that your code is pretty valid and works for me with no issues.

vdjurovic commented 1 year ago

You're right, that was the exact problem. Thanks!