[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: CSS themes update
From:       Michael_Strauß <michaelstrau2 () gmail ! com>
Date:       2021-08-28 14:09:30
Message-ID: CAJEpuXSXN5XZQDdeo=HWO5qnCgGHCt=XEOzTA2g7j9DrkdN2YA () mail ! gmail ! com
[Download RAW message or body]

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@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.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic