aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-screensaver/animations/ImageSlideshow.h
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-08-31 14:12:53 -0400
committerKen Moore <ken@ixsystems.com>2017-08-31 14:12:53 -0400
commita85dfaaaa460886d74d7a052a970ee75eb16f202 (patch)
tree4e2bc84e4476360245bbd7f4184b85d391fb844d /src-qt5/core/lumina-desktop-unified/src-screensaver/animations/ImageSlideshow.h
parentGet all the single-window interactions finished up. (diff)
downloadlumina-a85dfaaaa460886d74d7a052a970ee75eb16f202.tar.gz
lumina-a85dfaaaa460886d74d7a052a970ee75eb16f202.tar.bz2
lumina-a85dfaaaa460886d74d7a052a970ee75eb16f202.zip
A large amount of cleanup:
1) Fix the screen-alignment in a number of screensavers 2) Fix the restart-interval for screensavers (60 seconds by default) 3) Fix the cleanup of old screensaver objects between rotations 4) Add a default settings file for screensavers 5) Fix the prioritization of the settings files within DesktopSettings. 6) Turn off some event filter debugging
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-screensaver/animations/ImageSlideshow.h')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-screensaver/animations/ImageSlideshow.h38
1 files changed, 22 insertions, 16 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-screensaver/animations/ImageSlideshow.h b/src-qt5/core/lumina-desktop-unified/src-screensaver/animations/ImageSlideshow.h
index c040c7ac..fd98acb6 100644
--- a/src-qt5/core/lumina-desktop-unified/src-screensaver/animations/ImageSlideshow.h
+++ b/src-qt5/core/lumina-desktop-unified/src-screensaver/animations/ImageSlideshow.h
@@ -17,7 +17,7 @@ private:
QPropertyAnimation *bounce, *fading;
QPixmap pixmap;
QStringList imageFiles;
- QString imagePath, scriptPath;
+ QString imagePath, scriptPath, curpixmap;
QSize screenSize;
bool animate, scriptLoad;
@@ -40,27 +40,33 @@ private:
}
void chooseImage() {
- QString randomFile = imagePath+imageFiles[qrand() % imageFiles.size()];
- if(scriptLoad){
+ /*if(scriptLoad){
QProcess process;
process.start("/home/zwelch/test.sh");
process.waitForFinished(1000);
QByteArray output = process.readAllStandardOutput();
//qDebug() << output;
- pixmap.load(randomFile);
- }else{
- pixmap.load(randomFile);
- }
-
- //If the image is larger than the screen, then shrink the image down to 3/4 it's size (so there's still some bounce)
+ //pixmap.load(randomFile);
+ }else{*/
+ //File Load
+ QString randomFile = curpixmap;
+ if(imageFiles.size()>1 || curpixmap.isEmpty()){
+ while(curpixmap==randomFile){ randomFile = imagePath+imageFiles[qrand() % imageFiles.size()]; }
+ }
+ if(curpixmap!=randomFile){
+ //no need to load the new file or change the label
+ pixmap.load(randomFile);
+ //If the image is larger than the screen, then shrink the image down to 3/4 it's size (so there's still some bounce)
//Scale the pixmap to keep the aspect ratio instead of resizing the label itself
- if(pixmap.width() > screenSize.width() or pixmap.height() > screenSize.height()){
- pixmap = pixmap.scaled(screenSize*(3.0/4.0), Qt::KeepAspectRatio);
- }
+ if(pixmap.width() >= (screenSize.width()-10) || pixmap.height() >= (screenSize.height()-10) ){
+ pixmap = pixmap.scaled(screenSize*(3.0/4.0), Qt::KeepAspectRatio);
+ }
+ //Set pixmap to the image label
+ image->setPixmap(pixmap);
+ image->resize(pixmap.size());
+ }
+ //}
- //Set pixmap to the image label
- image->setPixmap(pixmap);
- image->resize(pixmap.size());
}
private slots:
@@ -69,7 +75,7 @@ private slots:
chooseImage();
setupAnimation();
}
- void stopped(){ qDebug() << "Image Stopped"; image->hide();}
+ void stopped(){ image->hide();}
public:
ImageSlideshow(QWidget *parent, QString path, bool animate, bool scriptLoad, QString scriptPath) : QParallelAnimationGroup(parent){
bgstack15