aboutsummaryrefslogtreecommitdiff
path: root/libLumina
diff options
context:
space:
mode:
Diffstat (limited to 'libLumina')
-rw-r--r--libLumina/LuminaThemes.cpp5
-rw-r--r--libLumina/LuminaUtils.cpp4
-rw-r--r--libLumina/colors/SampleColors.qss.colors1
3 files changed, 6 insertions, 4 deletions
diff --git a/libLumina/LuminaThemes.cpp b/libLumina/LuminaThemes.cpp
index 8548f739..0b328502 100644
--- a/libLumina/LuminaThemes.cpp
+++ b/libLumina/LuminaThemes.cpp
@@ -85,13 +85,13 @@ QStringList LTHEME::availableSystemIcons(){ //returns: [name] for each item
//Save a new theme/color file
bool LTHEME::saveLocalTheme(QString name, QStringList contents){
QString localdir = QDir::homePath()+"/.lumina/themes/";
- if(!QFile::exists(localdir)){ QDir dir(); dir.mkpath(localdir); }
+ if(!QFile::exists(localdir)){ QDir dir; dir.mkpath(localdir); }
return LUtils::writeFile(localdir+name+".qss.template", contents, true);
}
bool LTHEME::saveLocalColors(QString name, QStringList contents){
QString localdir = QDir::homePath()+"/.lumina/colors/";
- if(!QFile::exists(localdir)){ QDir dir(); dir.mkpath(localdir); }
+ if(!QFile::exists(localdir)){ QDir dir; dir.mkpath(localdir); }
return LUtils::writeFile(localdir+name+".qss.colors", contents, true);
}
@@ -154,6 +154,7 @@ QString LTHEME::assembleStyleSheet(QString themepath, QString colorpath, QString
else if(colors[i].startsWith("BASECOLOR=")){ stylesheet = stylesheet.replace("%%BASECOLOR%%", colors[i].section("=",1,1).simplified()); }
else if(colors[i].startsWith("ALTBASECOLOR=")){ stylesheet = stylesheet.replace("%%ALTBASECOLOR%%", colors[i].section("=",1,1).simplified()); }
else if(colors[i].startsWith("TEXTCOLOR=")){ stylesheet = stylesheet.replace("%%TEXTCOLOR%%", colors[i].section("=",1,1).simplified()); }
+ else if(colors[i].startsWith("TEXTDISABLECOLOR=")){ stylesheet = stylesheet.replace("%%TEXTDISABLECOLOR%%", colors[i].section("=",1,1).simplified()); }
else if(colors[i].startsWith("TEXTHIGHLIGHTCOLOR=")){ stylesheet = stylesheet.replace("%%TEXTHIGHLIGHTCOLOR%%", colors[i].section("=",1,1).simplified()); }
}
stylesheet = stylesheet.replace("%%FONT%%", font);
diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp
index 46c2e26c..6f91082c 100644
--- a/libLumina/LuminaUtils.cpp
+++ b/libLumina/LuminaUtils.cpp
@@ -54,9 +54,9 @@ QStringList LUtils::readFile(QString filepath){
bool LUtils::writeFile(QString filepath, QStringList contents, bool overwrite){
QFile file(filepath);
- QFile::OpenMode mode = overwrite ? (QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate) : (QIODevice::WriteOnly | QIODevice::Text);
+ if(file.exists() && !overwrite){ return false; }
bool ok = false;
- if(file.open( mode ) ){
+ if( file.open(QIODevice::WriteOnly | QIODevice::Truncate) ){
QTextStream out(&file);
out << contents.join("\n");
file.close();
diff --git a/libLumina/colors/SampleColors.qss.colors b/libLumina/colors/SampleColors.qss.colors
index fa770fa2..19f27ff5 100644
--- a/libLumina/colors/SampleColors.qss.colors
+++ b/libLumina/colors/SampleColors.qss.colors
@@ -9,4 +9,5 @@ ACCENTDISABLECOLOR=#f5f0e7
BASECOLOR=#f4f0e8
ALTBASECOLOR=white
TEXTCOLOR=black
+TEXTDISABLECOLOR=grey
TEXTHIGHLIGHTCOLOR=black \ No newline at end of file
bgstack15