aboutsummaryrefslogtreecommitdiff
path: root/lumina-wm-INCOMPLETE/animations
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-11-03 13:32:35 -0500
committerKen Moore <moorekou@gmail.com>2015-11-03 13:32:35 -0500
commit8417684b84a2ff4bb07c28c89274c045fd4104f8 (patch)
tree754ade19c856f79c00e3fdf3d9c220d62aa87e97 /lumina-wm-INCOMPLETE/animations
parentAdd all the animations framework for the screensaver side of lumina-wm (with ... (diff)
downloadlumina-8417684b84a2ff4bb07c28c89274c045fd4104f8.tar.gz
lumina-8417684b84a2ff4bb07c28c89274c045fd4104f8.tar.bz2
lumina-8417684b84a2ff4bb07c28c89274c045fd4104f8.zip
Clean up the Screensaver framework a bit more, add a test flag (--test-ss), and fix up the starting of screensavers on all screens simultaneously.
This solidifies the Screensaver plugin framework as completely functional - just need to finish up the lock/unlock screen now.
Diffstat (limited to 'lumina-wm-INCOMPLETE/animations')
-rw-r--r--lumina-wm-INCOMPLETE/animations/BaseAnimGroup.h2
-rw-r--r--lumina-wm-INCOMPLETE/animations/SampleAnimation.h22
2 files changed, 12 insertions, 12 deletions
diff --git a/lumina-wm-INCOMPLETE/animations/BaseAnimGroup.h b/lumina-wm-INCOMPLETE/animations/BaseAnimGroup.h
index 05c36ea2..dd7269d4 100644
--- a/lumina-wm-INCOMPLETE/animations/BaseAnimGroup.h
+++ b/lumina-wm-INCOMPLETE/animations/BaseAnimGroup.h
@@ -23,8 +23,6 @@ public:
BaseAnimGroup(QWidget *parent, QSettings *set){
canvas = parent;
settings = set;
- //Now load the animations for this particular plugin
- LoadAnimations();
}
~BaseAnimGroup(){}
diff --git a/lumina-wm-INCOMPLETE/animations/SampleAnimation.h b/lumina-wm-INCOMPLETE/animations/SampleAnimation.h
index 8e513426..7b027ce7 100644
--- a/lumina-wm-INCOMPLETE/animations/SampleAnimation.h
+++ b/lumina-wm-INCOMPLETE/animations/SampleAnimation.h
@@ -14,29 +14,31 @@
class SampleAnimation : public BaseAnimGroup{
Q_OBJECT
+private:
+ QWidget *ball;
+
public:
SampleAnimation(QWidget *parent, QSettings *set) : BaseAnimGroup(parent, set){}
-
~SampleAnimation(){}
-private:
- QWidget *ball;
- virtual void LoadAnimations(){
+ void LoadAnimations(){
+ qDebug() << "Loading Sample Animation";
ball = new QWidget(canvas);
//This creates a red "ball" on the widget which is going to expand/contract in the center of the screen
ball->setStyleSheet("background: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.341, fy:0.796, stop:0.00531915 rgba(107, 10, 10, 255), stop:0.521277 rgba(170, 10, 10, 255), stop:0.957447 rgba(200, 0, 0, 255), stop:0.994681 rgba(0, 0, 0, 225), stop:1 rgba(255, 255, 255, 0));");
- //ball->setSize(QSize(64,64));
- ball->move(canvas->geometry().center()-QPoint(32,32));
//Now setup the movements
- QPropertyAnimation *move = new QPropertyAnimation(ball,"size");
- move->setKeyValueAt(0, QSize(64, 64) );
+ QPropertyAnimation *move = new QPropertyAnimation(ball,"geometry");
+ QPoint ctr(canvas->width()/2, canvas->height()/2);
+ QRect initgeom(ctr-QPoint(12,12), QSize(24,24) );
+ move->setKeyValueAt(0, initgeom ); //starting point
+ move->setKeyValueAt(1, initgeom ); //ending point (same as start for continuity)
int size = canvas->width();
if(size > canvas->height()){ size = canvas->height(); }
- move->setKeyValueAt(0.5, QSize(size,size)); //touch the edge of the screen
- move->setKeyValueAt(1, QSize(64, 64) ); //back to original size
+ move->setKeyValueAt(0.5, QRect(ctr-QPoint(size/2, size/2), QSize(size,size))); //touch the edge of the screen
move->setDuration(10000); //10 seconds
this->addAnimation(move);
this->setLoopCount(10); //repeat 10 times
+ ball->show();
}
};
bgstack15