aboutsummaryrefslogtreecommitdiff
path: root/libLumina/LuminaThemes.cpp
diff options
context:
space:
mode:
authorwilliam <william.os4y@gmail.com>2015-03-20 08:02:04 +0100
committerwilliam <william.os4y@gmail.com>2015-03-20 08:02:04 +0100
commitd9ff9adac5b379cd9d96277dd48d0259b8545921 (patch)
treed7ba249ca026a1f1680df717caa5248d30a4b222 /libLumina/LuminaThemes.cpp
parentMerge remote-tracking branch 'upstream/master' into fmNumbers (diff)
parentUpdate some panel plugins so that they minimize empty space when only an icon... (diff)
downloadlumina-d9ff9adac5b379cd9d96277dd48d0259b8545921.tar.gz
lumina-d9ff9adac5b379cd9d96277dd48d0259b8545921.tar.bz2
lumina-d9ff9adac5b379cd9d96277dd48d0259b8545921.zip
Merge remote-tracking branch 'upstream/master' into fmNumbers
Diffstat (limited to 'libLumina/LuminaThemes.cpp')
-rw-r--r--libLumina/LuminaThemes.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/libLumina/LuminaThemes.cpp b/libLumina/LuminaThemes.cpp
index 269af259..e4c13ae7 100644
--- a/libLumina/LuminaThemes.cpp
+++ b/libLumina/LuminaThemes.cpp
@@ -177,10 +177,14 @@ LuminaThemeEngine::LuminaThemeEngine(QApplication *app){
theme = current[0]; colors=current[1]; icons=current[2]; font=current[3]; fontsize=current[4];
application->setStyleSheet( LTHEME::assembleStyleSheet(theme, colors, font, fontsize) );
QIcon::setThemeName(icons); //make sure this sets set within this environment
+ syncTimer = new QTimer(this);
+ syncTimer->setSingleShot(true);
+ syncTimer->setInterval(500); //wait 1/2 second before re-loading the files
watcher = new QFileSystemWatcher(this);
watcher->addPath( QDir::homePath()+"/.lumina/themesettings.cfg" );
watcher->addPaths( QStringList() << theme << colors ); //also watch these files for changes
connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT(watcherChange()) );
+ connect(syncTimer, SIGNAL(timeout()), this, SLOT(reloadFiles()) );
}
LuminaThemeEngine::~LuminaThemeEngine(){
@@ -188,6 +192,11 @@ LuminaThemeEngine::~LuminaThemeEngine(){
}
void LuminaThemeEngine::watcherChange(){
+ if(syncTimer->isActive()){ syncTimer->stop(); }
+ syncTimer->start();
+}
+
+void LuminaThemeEngine::reloadFiles(){
QStringList current = LTHEME::currentSettings();
application->setStyleSheet( LTHEME::assembleStyleSheet(current[0], current[1], current[3], current[4]) );
bgstack15