aboutsummaryrefslogtreecommitdiff
path: root/lumina-wm-INCOMPLETE/animations/SampleAnimation.h
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-11-02 10:31:39 -0500
committerKen Moore <moorekou@gmail.com>2015-11-02 10:31:39 -0500
commitb2c02af28049c4feed7a845505ef9a931237056a (patch)
tree535afc3e4aba5191a0604e70a78f7ca4a72f0762 /lumina-wm-INCOMPLETE/animations/SampleAnimation.h
parentCleanup how auto-start apps are launched a bit (start them via a single lumin... (diff)
downloadlumina-b2c02af28049c4feed7a845505ef9a931237056a.tar.gz
lumina-b2c02af28049c4feed7a845505ef9a931237056a.tar.bz2
lumina-b2c02af28049c4feed7a845505ef9a931237056a.zip
Add all the animations framework for the screensaver side of lumina-wm (with a quick "sample" plugin).
Diffstat (limited to 'lumina-wm-INCOMPLETE/animations/SampleAnimation.h')
-rw-r--r--lumina-wm-INCOMPLETE/animations/SampleAnimation.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/lumina-wm-INCOMPLETE/animations/SampleAnimation.h b/lumina-wm-INCOMPLETE/animations/SampleAnimation.h
new file mode 100644
index 00000000..8e513426
--- /dev/null
+++ b/lumina-wm-INCOMPLETE/animations/SampleAnimation.h
@@ -0,0 +1,43 @@
+//===========================================
+// Lumina-DE source code
+// Copyright (c) 2015, Ken Moore
+// Available under the 3-clause BSD license
+// See the LICENSE file for full details
+//===========================================
+// This class is the sample plugin for a ScreenSaver animation
+//===========================================
+#ifndef _LUMINA_DESKTOP_SCREEN_SAVER_SAMPLE_ANIMATION_H
+#define _LUMINA_DESKTOP_SCREEN_SAVER_SAMPLE_ANIMATION_H
+
+#include "GlobalDefines.h"
+#include "BaseAnimGroup.h"
+
+class SampleAnimation : public BaseAnimGroup{
+ Q_OBJECT
+public:
+ SampleAnimation(QWidget *parent, QSettings *set) : BaseAnimGroup(parent, set){}
+
+ ~SampleAnimation(){}
+
+private:
+ QWidget *ball;
+ virtual void LoadAnimations(){
+ 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) );
+ 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->setDuration(10000); //10 seconds
+ this->addAnimation(move);
+ this->setLoopCount(10); //repeat 10 times
+ }
+
+};
+#endif
bgstack15