SUMMARY Default font color for text file thumbnails is "View Text" but this can be set as white by KDE system theme and the white background of the thumbnail never changes. This is especially likely to happen when using dark/night color schemes. (Previews still load properly for any file that's interpreted as code, such as .py because the context highlighting overrides the font color and makes it readable.) Solution A) hard-code the font color on text file thumbnails so that it can't be changed by the system theme. This makes sense because the background color can't be changed either. Solution B) allow changing the background color of text file thumbnails through the system color scheme, and set it to a color that usually contrasts with the "View Text" color. STEPS TO REPRODUCE 1. In the KDE system settings, change the color scheme so that the "View Text" color is white (or just switch the overall system theme to the pre-installed 'Breeze Dark'). 2. In Dolphin, enable text file thumbnails. 3. In Dolphin, open a folder that contains plain text files (.txt or no file extension) that have text in them. OBSERVED RESULT Text file thumbnails show up as 'blank', despite the actual files having text in them. On very close inspection, you might notice that the text is actually there, but colored white against the white background. But it's barely visible and entirely unreadable. EXPECTED RESULT Text file thumbnails have black (or other dark color) text against the white background. SOFTWARE/OS VERSIONS Linux: Ubuntu 20.04 (with KDE installed on top) KDE Plasma Version: 5.18.5 KDE Frameworks Version: 5.68.0 Qt Version: 5.12.8 ADDITIONAL INFORMATION If somebody can point me to where in the code these colors are determined, I'd be happy to try and change it myself. Anyway, even if this bug is fixed, it will probably be a long time before the newly updated Dolphin version makes it onto the LTS versions of Ubuntu, so I'd very much appreciate the opportunity to fix it on my own PC, even if it means I have to compile my own fork of Dolphin to do so. (Hopefully, the thumbnails are actually generated by another package, so I could have my own fork or updated version of just that package. That would be ideal.)
I've found the code responsible for this! https://invent.kde.org/network/kio-extras/-/blob/master/thumbnail/textcreator.cpp line 131: QColor bgColor = QColor ( 245, 245, 245 ); // light-grey background This is where the background color is hard-coded. The font color is probably coming from one of these two lines: line 142: textDocument.setDefaultFont(font); line 147 textDocument.setDefaultTextOption(textOption); Since this seems to be an issue with the KIO repository, I'll see if I can make a but report there instead ... or maybe even a pull request. You can close this if you want to, unless you feel like trying to fix this bug from your end.