On Thu, 5 Jun 2025 00:50:30 GMT, Michael Strauß <mstra...@openjdk.org> wrote:

>> Implementation of 
>> [`StageStyle.EXTENDED`](https://gist.github.com/mstr2/0befc541ee7297b6db2865cc5e4dbd09).
>
> Michael Strauß has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   rename WindowManager to DesktopEnvironment

Just something to consider regarding this "dark" mode reliance on a Scene's 
fill property.

As far as I know, a Scene's fill property cannot be set via CSS.

I have a light and dark theme (two css files), and the user can pick "light" or 
"dark", for example. A few well-known apps have quite a few themes to choose 
from, like AtlantaFX-based apps. Other apps allow users to supply custom CSS 
files, such as JabRef.

In order for the window icons to appear correctly, one must programmatically 
call Scene.setFill(), setting it to something appropriate anytime a user 
changes theme, at runtime -- it seems to defeat the purpose of stylesheets a 
little to need to "know" how to set a scene's fill.

Would it be more flexible to check the background colour of the HeaderBar 
instead, and base the isDarkBackground() check off that? Runtime stylesheet 
changes would also be picked up by HeaderButtonOverlay which would 
automatically adjust the window icons, and the developer doesn't need to call 
any code. Let the developer decide the bg colour of the HeaderBar.

Would also cover the case where users might want a dark menu/header bar, but a 
otherwise "white" scene, or vica-versa.

-------------

PR Comment: https://git.openjdk.org/jfx/pull/1605#issuecomment-2951444277

Reply via email to