QKdeTheme: update color scheme with unknown desktop theme

When a KDE theme name doesn't contain the keywords "dark" or "light",
QKdeThemePrivate::updateColorScheme() falls back to heuristics. It
compares text and base color. It sets the color scheme to dark, if
text is lighter than base and otherwise to light.

When the theme name can't be read from KDE settings, because it is
stored on a different location or not yet set, the heuristics fallback
doesn't happen. The color scheme always becomes "Unknown".

Remove this limitation to the benefit of currently unsupported Linuxes.

Fixes: QTBUG-125285
Change-Id: I120dd23eee71b14ea8ce3735c3f53bda2caa403e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 71d0de98359decfcc9be01a0ed5823a9595ef5d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Axel Spoerl 2024-05-13 17:36:26 +02:00 committed by Qt Cherry-pick Bot
parent 56c37e7ddc
commit 1c2bd7809d

View File

@ -833,10 +833,7 @@ void QKdeThemePrivate::refresh()
const QVariant colorScheme = readKdeSetting(KdeSetting::ColorScheme);
if (colorScheme.isValid())
updateColorScheme(colorScheme.toString());
else
m_colorScheme = Qt::ColorScheme::Unknown;
updateColorScheme(colorScheme.toString());
const QVariant singleClickValue = readKdeSetting(KdeSetting::SingleClick);
if (singleClickValue.isValid())