[Svg] Don't reparse configuration in response to Theme::applicationPaletteChanged
Plasma::Theme emits the applicationPaletteChanged signal after it has fetched the colors from KColorScheme and scheduled the caches to be nuked. There's no need to do the same exact thing from every single Svg out there. This speeds up Plasma picking up color scheme changes significantly and is now on a par with other opened applications. REVIEW: 127426
This commit is contained in:
parent
28b4400da8
commit
bd354ecf70
@ -360,7 +360,7 @@ void ThemePrivate::colorsChanged()
|
||||
colorScheme = KColorScheme(QPalette::Active, KColorScheme::Window, colors);
|
||||
buttonColorScheme = KColorScheme(QPalette::Active, KColorScheme::Button, colors);
|
||||
viewColorScheme = KColorScheme(QPalette::Active, KColorScheme::View, colors);
|
||||
scheduleThemeChangeNotification(PixmapCache);
|
||||
scheduleThemeChangeNotification(PixmapCache | SvgElementsCache);
|
||||
emit applicationPaletteChange();
|
||||
}
|
||||
|
||||
|
@ -672,17 +672,7 @@ void SvgPrivate::colorsChanged()
|
||||
}
|
||||
|
||||
eraseRenderer();
|
||||
//qCDebug(LOG_PLASMA) << "repaint needed from colorsChanged";
|
||||
|
||||
// in the case the theme follows the desktop settings, refetch the colorschemes
|
||||
// and discard the svg pixmap cache
|
||||
if (!theme.data()->d->colors) {
|
||||
KSharedConfig::openConfig()->reparseConfiguration();
|
||||
theme.data()->d->colorScheme = KColorScheme(QPalette::Active, KColorScheme::Window);
|
||||
theme.data()->d->buttonColorScheme = KColorScheme(QPalette::Active, KColorScheme::Button);
|
||||
theme.data()->d->viewColorScheme = KColorScheme(QPalette::Active, KColorScheme::View);
|
||||
theme.data()->d->discardCache(PixmapCache | SvgElementsCache);
|
||||
}
|
||||
qCDebug(LOG_PLASMA) << "repaint needed from colorsChanged";
|
||||
|
||||
emit q->repaintNeeded();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user