Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix: Remove imports from css and use a list of stylesheets instead #745

Merged
merged 3 commits into from
Oct 2, 2024

Conversation

jperedadnr
Copy link
Collaborator

@jperedadnr jperedadnr commented Oct 2, 2024

Issue

Fixes #744

Long story short: the @import "com/sun.../modena.css in the css files weren't working (even before the modular changes from #720), as new URL("com.../modena.css)` wasn't being resolved at all.

This also means that CSSInternal::getThemeStyleClasses didn't work at all, because URL("com/....css") is not a valid URL.

This PR moves those CSS imports into code, as a list of different stylesheets used by each theme works (because Javafx-graphics/CSS uses the URLConverter and produces the correct URL(with the right file://javafx.controls.jar!...css path).

Also, CSSInternal::getThemeStyleClasses now uses a class from javafx-controls, so getResource returns a valid URL.

As a result themes are working now:

image

Progress

Copy link
Collaborator

@Oliver-Loeffler Oliver-Loeffler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I've tested on Windows and it works.

@Oliver-Loeffler Oliver-Loeffler merged commit 9d152a6 into gluonhq:master Oct 2, 2024
3 checks passed
@jperedadnr jperedadnr deleted the 744-touchcss branch October 2, 2024 19:18
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't access modena-touch.css
2 participants