colorScheme and buttonColorScheme need to be updated the color changes
for system-color themes. Also clear out itemsToSave on colorChange. svn path=/trunk/KDE/kdelibs/; revision=898780
This commit is contained in:
parent
0b9f1db281
commit
fb3d7e75cb
2
svg.cpp
2
svg.cpp
@ -366,6 +366,8 @@ class SvgPrivate
|
||||
}
|
||||
|
||||
eraseRenderer();
|
||||
itemsToSave.clear();
|
||||
saveTimer->stop();
|
||||
emit q->repaintNeeded();
|
||||
}
|
||||
|
||||
|
14
theme.cpp
14
theme.cpp
@ -100,6 +100,7 @@ public:
|
||||
void compositingChanged();
|
||||
void discardCache();
|
||||
void discardCache(bool recreateElementsCache);
|
||||
void colorsChanged();
|
||||
bool useCache();
|
||||
|
||||
static const char *defaultTheme;
|
||||
@ -187,10 +188,10 @@ void ThemePrivate::discardCache()
|
||||
|
||||
void ThemePrivate::discardCache(bool recreateElementsCache)
|
||||
{
|
||||
KPixmapCache::deleteCache("plasma_theme_" + themeName);
|
||||
delete pixmapCache;
|
||||
pixmapCache = 0;
|
||||
invalidElements.clear();
|
||||
KPixmapCache::deleteCache("plasma_theme_" + themeName);
|
||||
|
||||
svgElementsCache = 0;
|
||||
|
||||
@ -205,6 +206,13 @@ void ThemePrivate::discardCache(bool recreateElementsCache)
|
||||
}
|
||||
}
|
||||
|
||||
void ThemePrivate::colorsChanged()
|
||||
{
|
||||
discardCache(true);
|
||||
colorScheme = KColorScheme(QPalette::Active, KColorScheme::Window, colors);
|
||||
buttonColorScheme = KColorScheme(QPalette::Active, KColorScheme::Button, colors);
|
||||
}
|
||||
|
||||
class ThemeSingleton
|
||||
{
|
||||
public:
|
||||
@ -331,14 +339,14 @@ void Theme::setThemeName(const QString &themeName)
|
||||
disconnect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
|
||||
this, SIGNAL(themeChanged()));
|
||||
disconnect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
|
||||
this, SLOT(discardCache()));
|
||||
this, SLOT(colorsChanged()));
|
||||
|
||||
if (colorsFile.isEmpty()) {
|
||||
d->colors = 0;
|
||||
connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
|
||||
this, SIGNAL(themeChanged()));
|
||||
connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
|
||||
this, SLOT(discardCache()));
|
||||
this, SLOT(colorsChanged()));
|
||||
} else {
|
||||
d->colors = KSharedConfig::openConfig(colorsFile);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user