aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/LDesktop.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2016-05-13 07:33:41 -0400
committerKen Moore <moorekou@gmail.com>2016-05-13 07:33:41 -0400
commit80ec75948133283e0de56c341db243f917878736 (patch)
tree499e1174c0fb93120a2566879d20d39f3ecb64ce /src-qt5/core/lumina-desktop/LDesktop.cpp
parentMerge pull request #224 from HenryHu/skip_taskbar (diff)
parentMove background processing into LDesktopBackground class (diff)
downloadlumina-80ec75948133283e0de56c341db243f917878736.tar.gz
lumina-80ec75948133283e0de56c341db243f917878736.tar.bz2
lumina-80ec75948133283e0de56c341db243f917878736.zip
Merge pull request #223 from HenryHu/master
add 2 options for background image: fit and full
Diffstat (limited to 'src-qt5/core/lumina-desktop/LDesktop.cpp')
-rw-r--r--src-qt5/core/lumina-desktop/LDesktop.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/src-qt5/core/lumina-desktop/LDesktop.cpp b/src-qt5/core/lumina-desktop/LDesktop.cpp
index 72b267b0..113b7efc 100644
--- a/src-qt5/core/lumina-desktop/LDesktop.cpp
+++ b/src-qt5/core/lumina-desktop/LDesktop.cpp
@@ -214,7 +214,7 @@ void LDesktop::InitDesktop(){
connect(QApplication::instance(), SIGNAL(LocaleChanged()), this, SLOT(LocaleChanged()) );
if(DEBUG){ qDebug() << "Create bgWindow"; }
- bgWindow = new QWidget();
+ bgWindow = new LDesktopBackground();
bgWindow->setObjectName("bgWindow");
bgWindow->setContextMenuPolicy(Qt::CustomContextMenu);
bgWindow->setFocusPolicy(Qt::StrongFocus);
@@ -500,19 +500,8 @@ 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;
QString format = settings->value(DPREFIX+"background/format","stretch").toString();
- if(bgFile.startsWith("rgb(")){ style = "QWidget#bgWindow{ border-image: none; background-color: %1;}";
- }else if( format == "center"){ style = "QWidget#bgWindow{ background: black url(%1); background-position: center; background-repeat: no-repeat; }";
- }else if( format == "topleft"){ style = "QWidget#bgWindow{ background: black url(%1); background-position: top left; background-repeat: no-repeat; }";
- }else if( format == "topright"){ style = "QWidget#bgWindow{ background: black url(%1); background-position: top right; background-repeat: no-repeat; }";
- }else if( format == "bottomleft"){ style = "QWidget#bgWindow{ background: black url(%1); background-position: bottom left; background-repeat: no-repeat; }";
- }else if( format == "bottomright"){ style = "QWidget#bgWindow{ background: black url(%1); background-position: bottom right; background-repeat: no-repeat; }";
- }else if( format == "tile"){ style = "QWidget#bgWindow{ background-color: black; border-image:url(%1) repeat;}";
- }else{ /* STRETCH*/ style = "QWidget#bgWindow{ background-color: black; border-image:url(%1) stretch;}"; }
- style = style.arg(bgFile);
- bgWindow->setStyleSheet(style);
- bgWindow->show();
+ bgWindow->setBackground(bgFile, format);
//Now reset the timer for the next change (if appropriate)
if(bgtimer->isActive()){ bgtimer->stop(); }
if(bgL.length() > 1){
bgstack15