Update QStyleHints::colorScheme before updating palettes
The code polshing palettes needs to be able to rely on an updated value of the color scheme as reported by the QStyleHints, otherwise styles might apply the incorrect polishing logic. Update the style hints as part of processing theme change handling, and do it as the first thing, before updating the palette. Pick-to: 6.7 Task-number: QTBUG-124490 Change-Id: I393faa57ecfa6da94497ae93a4e8b5d2782ec42a Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>bb10
parent
8bc80f2e1a
commit
b5215f65c0
|
|
@ -2643,10 +2643,6 @@ void QGuiApplicationPrivate::processThemeChanged(QWindowSystemInterfacePrivate::
|
|||
|
||||
QIconPrivate::clearIconCache();
|
||||
|
||||
const auto newColorScheme = platformTheme() ? platformTheme()->colorScheme()
|
||||
: Qt::ColorScheme::Unknown;
|
||||
QStyleHintsPrivate::get(QGuiApplication::styleHints())->updateColorScheme(newColorScheme);
|
||||
|
||||
QEvent themeChangeEvent(QEvent::ThemeChange);
|
||||
const QWindowList windows = tce->window ? QWindowList{tce->window} : window_list;
|
||||
for (auto *window : windows)
|
||||
|
|
@ -2655,6 +2651,10 @@ void QGuiApplicationPrivate::processThemeChanged(QWindowSystemInterfacePrivate::
|
|||
|
||||
void QGuiApplicationPrivate::handleThemeChanged()
|
||||
{
|
||||
const auto newColorScheme = platformTheme() ? platformTheme()->colorScheme()
|
||||
: Qt::ColorScheme::Unknown;
|
||||
QStyleHintsPrivate::get(QGuiApplication::styleHints())->updateColorScheme(newColorScheme);
|
||||
|
||||
updatePalette();
|
||||
|
||||
QIconLoader::instance()->updateSystemTheme();
|
||||
|
|
|
|||
Loading…
Reference in New Issue