raspberrypi / rpi-imager

The home of Raspberry Pi Imager, a user-friendly tool for creating bootable media for Raspberry Pi devices.
https://www.raspberrypi.com/software
Other
1.63k stars 246 forks source link

[BUG] Can't read text in customization menu. Font seems to be white on a white background #735

Open MostHated opened 9 months ago

MostHated commented 9 months ago

Describe the bug A clear and concise description of what the bug is. Can't read text in the customization menu. The font seems to be white on a white background

To Reproduce Include steps to allow us to reproduce the error. Include your host OS, I installed the 1.8.1 deb which was linked from a site, but then I saw 1.8.3 was available, but the issue occurs the same in both versions.

Expected behavior A clear and concise description of what you expected to happen. Can't read text. The font seems to be white on a white background

Screenshots If applicable, add screenshots to help explain your problem.

rpi_imager.webm

Desktop (please complete the following information):

The name of the OS you are trying to write The current default recommended one, which I believe was debian bookworm?

Are you using OS Customisation? Yes, that is where the main issue occurs

Additional context Add any other context about the problem here. Not sure if it's theme related, or something? I don't believe I have anything special going on, on the host OS in which I am running the imager. It is all pretty stock in order to stay in spec for Unity3d support.

lurch commented 9 months ago

I looks like you've enabled a "dark" theme (because of the white text on a grey background on the tab-labels and text-boxes) ? But it looks like some parts of RPi Imager are using the theme-colours, but some parts are ignoring the theme-colours?

tdewey-rpi commented 9 months ago

Thanks for the report, @MostHated. In particular, thanks for providing a video - much more helpful than a usual report.

I'll take a look at this later today - we've not consciously decided to break Dark Mode support, so this is a curiosity.

maxnet commented 9 months ago

Any difference if you start a terminal, and enter:

LIBGL_ALWAYS_SOFTWARE=1 rpi-imager
tdewey-rpi commented 9 months ago

Took a quick look at the OptionsPopup code - and sure enough, we're not actually enforcing a colour beyond the items that are still visible in the video.

MostHated commented 9 months ago

Glad to hear it was relatively easy to locate the issue. I had to try and scour a number of websites trying to find out what the text on those tabs said, which wasn't as easy as it sounds. At least for the last page. Most sites only showed the first and second pages.

@maxnet I gave that a try just to see if it made a difference, though it did not seem to have any effect.

maxnet commented 9 months ago

If it's the theme than you can probably use "QT_QUICK_CONTROLS_MATERIAL_THEME=Light rpi-imager" as a workaround. But it is uncommon for Ubuntu to set that. Their normal light/dark setting only changes the color of title bar.

lurch commented 9 months ago

I had to try and scour a number of websites trying to find out what the text on those tabs said, which wasn't as easy as it sounds.

There's a big bunch of screenshots in the documentation. @tdewey-rpi Do you think it's worth linking to there from this project's README.md ?

tdewey-rpi commented 9 months ago

@MostHated Could you please try and load rpi-imager with a theme override? I'd like to understand if this is an interaction with the Qt5 default theme and your Dark Mode theme:

Try:

rpi-imager -style gtk2

MostHated commented 9 months ago

Sure thing. Looks about the same.

image_20231121125454

tdewey-rpi commented 9 months ago

Thanks for the test, @MostHated.

It does indeed look like the Qt5 default themes are not interacting well with your OS theme - with some controls in your installation getting the theme assets, but others not - most notably, the default QtQuick.Window control we're using appears to have ignored the request for a dark base colour - which the parent window did get.

I'll begin investigations on the difference between how we're setting up these Windows, which might get me to the solution. In the meantime, any details you can provide me on how to configure a desktop to match your theme & OS combination would be much appreciated - as I don't want to annoy you with an endless stream of test builds.

maxnet commented 9 months ago

It does indeed look like the Qt5 default themes are not interacting well with your OS theme

It's Qt5's own "Dark" material design theme that you are seeing. Which you can also play with yourself by setting the right environment variable:

dark

The question do is why that is being used. Just setting Ubuntu OS theme to dark is not sufficient to cause the dark Qt theme to be used in Imager... That only colors the title bar black:

dark-kubuntu

(at least in Kubuntu)

Anyway, you can probably just qputenv QT_QUICK_CONTROLS_MATERIAL_THEME to "Light" to force everyone to use light.

MostHated commented 9 months ago

It looks like I had set a few env variables prior related to QT apps. Though, this is the first time I have ever seen it have any sort of negative effect, and as such, I don't think about it often, and forget I ever did it. I think that I might have done this because one of my other applications, possibly BackInTime was having an issue, and these settings fixed it, but I can't say for sure, as that was about a year ago or more.

(Redacted a few personal items, and I don't recall if that lower item in my config that is highlighted is related, might not be)

https://img.instance.id/FqsQu5u2CMQo/direct

tdewey-rpi commented 9 months ago

Thanks for the update, @MostHated

Sure enough - setting QT_QPA_PLATFORMTHEME="qt5ct" means that we're no longer using the default Qt themes at all - instead, we're using the configuration specified in the Qt5 configuration tool (as you've shown us). This is a bit of a conundrum:

That said, I'm not going to close this - because although there's clearly some missing override (we appear to have picked up your change to the foreground font colour, but not the base window colour).

We'll need to decide what we want Imager to do in these situations - do we just completely ignore user customisation and try to work around the palette override (probably the simplest path), or do we try to map the Options dialog to the Window customisation that seems to work on the main window.