RFR: 8345348: CSS Media Queries
Michael Strauß
mstrauss at openjdk.org
Mon Dec 2 23:35:53 UTC 2024
On Mon, 2 Dec 2024 21:24:52 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> Implementation of [CSS media queries](https://gist.github.com/mstr2/cbb93bff03e073ec0c32aac317b22de7).
>
> modules/javafx.graphics/src/main/java/javafx/scene/Scene.java line 1212:
>
>> 1210: * @since 24
>> 1211: */
>> 1212: private final ObjectProperty<ColorScheme> colorScheme = new MediaProperty<>(
>
> is it possible for two different scenes to have different color schemes or any other properties derived from the platform preferences?
>
> would it make more sense to use the platform preferences properties directly?
I think we need a way for applications to override the OS preferences. Most applications that offer light and dark themes also allow users to switch between them independently from the OS. The advantage of allowing `Scene` to override those properties is that an application can mix and match light and dark themes (so to answer your question: yes, different scenes can have different color schemes).
This might be useful for stylistic or compatibility reasons. For example, an application might use third-party UI components in tool windows that don't work well with a dark theme (maybe even Swing content), so these windows would use a color scheme that is different from the main window.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1655#discussion_r1866729598
More information about the openjfx-dev
mailing list