cssfx
cssfx copied to clipboard
CSSFX doesn't monitor changes in Application stylesheet
When I define global CSS file for all stages of javafx application (see below), then changes aren't reloaded.
final URL globalCssFile = getClass().getResource("styles/Global.css");
Application.setUserAgentStylesheet(globalCssFile.toExternalForm());
@McFoggy Any news on this issue?
Any news on this issue?
Not really. I had a quick look at it but the global stylesheet is not Observable and is a bit special thus it will require a special handling and probably either a specific monitoring or a new API to be called by CSSFX users.
Also, new JavaFX versions (9+) seems to have introduced a regression. In JavaFX 8 I was able to change the user agent stylesheet and then call reapplyCss() or impl_reapplyCss() and the new style would be applied It doesn't work anymore though
@palexdev please do not mix problems in the same issue, open another issue describe the problem and potentially provide a reproducer. By the way as we do not touch the user agent style, is it related to CSSFX? did you try to reproduce without it?
Sorry I thought it might be a useful information. No, it's not related to CSSFX, it's related to this change JDK-8088253, reverting that commit fixes the problem, I'm testing it further and then I'm going to contact the devs
It looks like a bit tricky issue or inappropriate use case. Do you know any workaround? I'd like to use CssFx, but I also want to have one global CSS file, which I don't need to include in every new window opened by application. The code above was the only solution I'd found out. It's not the best one, because then I need to have modena.css included in my global.css file via @include. Does JavaFX provide any other solution?
Anyway, Thanks for your time!
The only workaround I see right now is to include your CSS in the top windows instead. If you find some other ways, fill free to send a PR.