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();
|
eraseRenderer();
|
||||||
|
itemsToSave.clear();
|
||||||
|
saveTimer->stop();
|
||||||
emit q->repaintNeeded();
|
emit q->repaintNeeded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
14
theme.cpp
14
theme.cpp
@ -100,6 +100,7 @@ public:
|
|||||||
void compositingChanged();
|
void compositingChanged();
|
||||||
void discardCache();
|
void discardCache();
|
||||||
void discardCache(bool recreateElementsCache);
|
void discardCache(bool recreateElementsCache);
|
||||||
|
void colorsChanged();
|
||||||
bool useCache();
|
bool useCache();
|
||||||
|
|
||||||
static const char *defaultTheme;
|
static const char *defaultTheme;
|
||||||
@ -187,10 +188,10 @@ void ThemePrivate::discardCache()
|
|||||||
|
|
||||||
void ThemePrivate::discardCache(bool recreateElementsCache)
|
void ThemePrivate::discardCache(bool recreateElementsCache)
|
||||||
{
|
{
|
||||||
|
KPixmapCache::deleteCache("plasma_theme_" + themeName);
|
||||||
delete pixmapCache;
|
delete pixmapCache;
|
||||||
pixmapCache = 0;
|
pixmapCache = 0;
|
||||||
invalidElements.clear();
|
invalidElements.clear();
|
||||||
KPixmapCache::deleteCache("plasma_theme_" + themeName);
|
|
||||||
|
|
||||||
svgElementsCache = 0;
|
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
|
class ThemeSingleton
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -331,14 +339,14 @@ void Theme::setThemeName(const QString &themeName)
|
|||||||
disconnect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
|
disconnect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
|
||||||
this, SIGNAL(themeChanged()));
|
this, SIGNAL(themeChanged()));
|
||||||
disconnect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
|
disconnect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
|
||||||
this, SLOT(discardCache()));
|
this, SLOT(colorsChanged()));
|
||||||
|
|
||||||
if (colorsFile.isEmpty()) {
|
if (colorsFile.isEmpty()) {
|
||||||
d->colors = 0;
|
d->colors = 0;
|
||||||
connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
|
connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
|
||||||
this, SIGNAL(themeChanged()));
|
this, SIGNAL(themeChanged()));
|
||||||
connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
|
connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
|
||||||
this, SLOT(discardCache()));
|
this, SLOT(colorsChanged()));
|
||||||
} else {
|
} else {
|
||||||
d->colors = KSharedConfig::openConfig(colorsFile);
|
d->colors = KSharedConfig::openConfig(colorsFile);
|
||||||
}
|
}
|
||||||
|
1
theme.h
1
theme.h
@ -259,6 +259,7 @@ class PLASMA_EXPORT Theme : public QObject
|
|||||||
|
|
||||||
Q_PRIVATE_SLOT(d, void compositingChanged())
|
Q_PRIVATE_SLOT(d, void compositingChanged())
|
||||||
Q_PRIVATE_SLOT(d, void discardCache())
|
Q_PRIVATE_SLOT(d, void discardCache())
|
||||||
|
Q_PRIVATE_SLOT(d, void colorsChanged())
|
||||||
};
|
};
|
||||||
|
|
||||||
} // Plasma namespace
|
} // Plasma namespace
|
||||||
|
Loading…
Reference in New Issue
Block a user