CSS themes update
Michael Strauß
michaelstrau2 at gmail.com
Sat Aug 28 14:09:30 UTC 2021
A point for discussion:
Rather than re-using the setUserAgentStylesheet(String) API for
themes, another option would be to introduce an additional
setTheme(Theme) API, so that this code:
Application.setUserAgentStylesheet(new MyTheme().toURL());
could be expressed like this:
Application.setTheme(new MyTheme());
In this case, setting a theme could either
1. override a user-agent stylesheet
2. go before a user-agent stylesheet
3. go after a user-agent stylesheet
One advantage of a separate API would be that it avoids the need to
pass themes by a string URL and retains the strong typing afforded by
a specialized API.
On the other hand, an advantage of the existing string API would be
that it works with the "javafx.userAgentStylesheetUrl" VM option, and
it allows specifying themes as text attributes in FXML files:
<SubScene userAgentStylesheet="theme:com.example.MyTheme"/>
On Thu, Aug 26, 2021 at 7:02 AM Michael Strauß <michaelstrau2 at gmail.com> wrote:
>
> Circling back to CSS themes. I've posted an update on the API:
> https://github.com/openjdk/jfx/pull/511#issuecomment-906092328
>
> Comments appreciated.
More information about the openjfx-dev
mailing list