macOS: Lazily recreate theme palette on theme change

QCocoaTheme::palette() lazily creates the system and role palette
when needed, which we rely on for the initial palette values, so
there's no need to recreate them explicitly during theme change,
as the reset should be enough to recreate them the next time they
are needed.

Change-Id: I14f127e93554b8f97c06f1b88e6216be59124811
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Tor Arne Vestbø 2025-04-15 23:36:12 +02:00
parent 48f161e129
commit fb555ff7df

View File

@ -245,9 +245,6 @@ void QCocoaTheme::handleSystemThemeChange()
updateColorScheme();
m_systemPalette = qt_mac_createSystemPalette();
m_palettes = qt_mac_createRolePalettes();
if (QCoreTextFontEngine::fontSmoothing() == QCoreTextFontEngine::FontSmoothing::Grayscale) {
// Re-populate glyph caches based on the new appearance's assumed text fill color
QFontCache::instance()->clear();