diff options
author | Ken Moore <ken@pcbsd.org> | 2015-05-20 12:35:29 -0400 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-05-20 12:35:29 -0400 |
commit | 7bbce842ff95ca65a60b9c0b4bf517d1bce15576 (patch) | |
tree | ede8af9cef6ae13f7bced3abb861f8e0815ff943 /lumina-desktop | |
parent | Fix a bug in the background snapshot finder: the new simplification routine w... (diff) | |
download | lumina-7bbce842ff95ca65a60b9c0b4bf517d1bce15576.tar.gz lumina-7bbce842ff95ca65a60b9c0b4bf517d1bce15576.tar.bz2 lumina-7bbce842ff95ca65a60b9c0b4bf517d1bce15576.zip |
Add the ability to set solid-color backgrounds within Lumina, and add this option to lumina-config.
Diffstat (limited to 'lumina-desktop')
-rw-r--r-- | lumina-desktop/LDesktop.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp index 5e61db8a..07333c74 100644 --- a/lumina-desktop/LDesktop.cpp +++ b/lumina-desktop/LDesktop.cpp @@ -547,7 +547,7 @@ void LDesktop::UpdateBackground(){ //qDebug() << " - List:" << bgL << CBG; //Remove any invalid files for(int i=0; i<bgL.length(); i++){ - if( (!QFile::exists(bgL[i]) && bgL[i]!="default") || bgL[i].isEmpty()){ bgL.removeAt(i); i--; } + if( (!QFile::exists(bgL[i]) && bgL[i]!="default" && !bgL[i].startsWith("rgb(") ) || bgL[i].isEmpty()){ bgL.removeAt(i); i--; } } if(bgL.isEmpty()){ bgL << "default"; } //always fall back on the default //Determine if the background needs to be changed @@ -574,7 +574,13 @@ void LDesktop::UpdateBackground(){ //qDebug() << " - Set Background to:" << CBG << index << bgL; if( (bgFile.toLower()=="default")){ bgFile = LOS::LuminaShare()+"desktop-background.jpg"; } //Now set this file as the current background - QString style = "QWidget#bgWindow{ border-image:url(%1) stretch;}"; + QString style; + if(bgFile.startsWith("rgb(")){ + //qDebug() << "Set background color:" << bgFile; + style = "QWidget#bgWindow{ border-image: none; background-color: %1;}"; + }else{ + style = "QWidget#bgWindow{ background-color: black; border-image:url(%1) stretch;}"; + } style = style.arg(bgFile); bgWindow->setStyleSheet(style); bgWindow->show(); |