Hi Christopher!

> - Should this feature work in that ea version?

Yes.


> - Is Windows 10 supported by the color scheme detection?

Color scheme detection should be supported on Windows 10 beginning
with build 10240.


> - The documentation says that LIGHT is returned in case theme the
> detection is not supported. But I guess there is no way to find out
> whether querying that property is supported on the current system? It
> might be useful in some circumstances to adapt the behavior when we know
> that this is not supported.

There is no way to directly query whether any of the
platform-independent properties (colorScheme, backgroundColor,
foregroundColor, accentColor) are supported by the current OS.
You can check whether the platform-dependent mappings (for example,
"Windows.UIColor.Background") are contained in the map, which will
only be the case if supported by the OS.


> - The documentation mentions that some preferences might not be
> available on the current system. Does that mean that if they are
> available, they are also observable? Or might it be possible that a
> certain setting is available but does not support dynamically updating
> at runtime and cannot be observed?

If you see a mapping for a preference, it should also be updated
automatically if the corresponding OS setting is changed.

Do you see the mappings for "Windows.UIColor.Background" and
"Windows.UIColor.Foreground" in the map returned by
Platform.getPreferences()?
The color scheme value is derived from these colors. If the mappings
are not present, something unexpected is happening.



On Mon, Jan 29, 2024 at 9:23 PM Christopher Schnick <crschn...@xpipe.io> wrote:
>
> Hello,
>
> I just tried out the new 22-ea+27 build to see whether we can utilize
> some of the new features, particularly the platform preferences API, to
> replace the library https://github.com/Dansoftowner/jSystemThemeDetector
> that we are currently using for theme detection.
>
> I'm running this on Windows 10 with the latest updates and the color
> scheme always reports LIGHT, even when dark mode is enabled in the
> settings. The observable value also does not update when the value
> changes in the settings. Obviously I have a few questions here:
> - Should this feature work in that ea version?
> - Is Windows 10 supported by the color scheme detection?
> - The documentation says that LIGHT is returned in case theme the
> detection is not supported. But I guess there is no way to find out
> whether querying that property is supported on the current system? It
> might be useful in some circumstances to adapt the behavior when we know
> that this is not supported.
> - The documentation mentions that some preferences might not be
> available on the current system. Does that mean that if they are
> available, they are also observable? Or might it be possible that a
> certain setting is available but does not support dynamically updating
> at runtime and cannot be observed?
>
> Best regards
> Christopher
>

Reply via email to