bitcraze / crazyflie-clients-python

Host applications and library for Crazyflie written in Python.
Other
301 stars 468 forks source link

LH calibration - Invisible text (dark theme) #691

Open matejkarasek opened 9 months ago

matejkarasek commented 9 months ago

The newly introduced dark/black theme is very nice! Unfortunately, in the Lighthouse calibration wizard we now get white text on white background in the text field, where calibration result messages are plotted.

Observed in Win 11 with dark windows theme, cfcleint 2023.11 and the "default" cfclient theme

knmcguire commented 9 months ago

Hi! Oh yes this is absolutely a bug. Thanks for spotting!

For reference, this is with the light theme it is supposed to look like this:

image and in dark theme/hacker theme, it looks like this. image

This is because we use .png with transparent background for the images... either we have to make a white variant of that, (which it switches if a black theme is selected) or add a colored background to it. The latter is probably better.

matejkarasek commented 9 months ago

@knmcguire In fact, this is a different bug than what I reported...

What I observe might be related to Qt6 which seems to respond to the "light/dark" settings of the Windows 11 theme (Personalization --> Colors --> Choose your mode: "Light/Dark")

I use the "Dark" theme in Windows and now the cfclient with the "Default" theme looks like this (I like this very much): Screenshot 2023-12-14 131512

However, if I want to do Lighthouse calibration then I get this: Screenshot 2023-12-14 131728

Strangely, if I switch to a different cfclient theme (e.g. "Navy blue") and then switch back to "Default", this gets fixed (well the window title is still not visible...): Screenshot 2023-12-14 131808

knmcguire commented 9 months ago

Ahhh so that's a different issue! hmm... the first seems to be an actual bug in either windows or QT so that might be difficult to solve.

matejkarasek commented 9 months ago

Not sure.... More info here, it seems that this autoswitching to dark mode is ("fusion" style of QT6) might be enabled in cfclient, and that there might be a conflict with some of the styles defined in cfclient?

knmcguire commented 8 months ago

hmmm yeah, we have it enabled here:

https://github.com/bitcraze/crazyflie-clients-python/blob/1e888476f1e93fd48bc186bd211b6b88a612ab05/src/cfclient/gui.py#L170

If I uncomment it, it won't switch to the dark theme so the problem is not there anymore. It is too bad but that would be the quickest solution.

Weirdly, the same thing doesn't happen for the other dialogs it seems like the initial geometry dialog where you have to start this wizard from.

I also noticed, if the theme is changed on windows while cfclient is started, it doesn't work great either

knmcguire commented 1 month ago

This seems to be bugging more and more people so I propose just to remove that line. I need to wait until there are more people at the office to review the PRs, but at least I'll mark it for triage