Powertoys: [Settings] Bug: Text isn't theme aware

Created on 25 Jul 2020  路  3Comments  路  Source: microsoft/PowerToys

In #5113 we have moved away from custom TextBlocks to a Converter to make sure all labels change color when the module is disabled.
image

Apparently the brushes aren't theme aware, resulting in a bug where text doesn't show at all.

Steps to reproduce:
1) Open Settings
2) Change Settings theme (from e.g. light to dark)
3) Navigate to e.g. Color Picker settings page

SettingsThemingbug

Solution:
We change the RequestTheme of the Window, not the App itself (this can only be done in the constructor). When switching themes in W10 Settings the problem doesn't occur.

As a quick fix, we could set the TextBlocks to their default Foreground. And changing the Converter from Foreground to Opacity. So if the module is enabled, Opacity = 1, if not Opacity = 0.5. Visually it will have the same effect, but just a bit of a hack.

@crutkas @laviusmotileng-ms Any other ideas?

Issue-Bug Product-Settings Resolution-Fix-Committed

All 3 comments

If it is enabled and theme is dark:
return light color.

if it is enabled and theme is light:
return dark color

if it is enabled and theme is system theme:
check if the system theme is dark, if so:
return light text color.
otherwise:
return dark color.

image

@laviusmotileng-ms Ah yes, that makes more sense. Will try that out and have to look up the actual brush values/colors for both brushes in dark/light.

We just released 0.20 and this should be resolved there. Please try it out.

Was this page helpful?
0 / 5 - 0 ratings