aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Warp.json25
-rw-r--r--src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Warp.qml57
-rw-r--r--src-qt5/src-cpp/plugins-screensaver.cpp8
3 files changed, 86 insertions, 4 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Warp.json b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Warp.json
new file mode 100644
index 00000000..888df01f
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/Warp.json
@@ -0,0 +1,25 @@
+{
+ "name" : {
+ "default" : "Warp"
+ },
+ "description" : {
+ "default" : "Warp trail through the stars"
+ },
+ "author" : {
+ "name" : "Ken Moore",
+ "email" : "ken@ixsystems.com",
+ "website" : "https://github.com/beanpole135",
+ "company" : "iXsystems",
+ "company_website" : "http://ixsystems.com"
+ },
+ "meta" : {
+ "license" : "3-clause BSD",
+ "license_url" : "https://github.com/trueos/lumina/blob/master/LICENSE",
+ "copyright" : "Copyright (c) 2017, Ken Moore (ken@ixsystems.com)",
+ "date_created" : "20171012",
+ "version" : "1.0"
+ },
+ "qml" : {
+ "exec" : "qml_scripts/Warp.qml"
+ }
+}
diff --git a/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Warp.qml b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Warp.qml
new file mode 100644
index 00000000..4ad4378f
--- /dev/null
+++ b/src-qt5/core/lumina-desktop-unified/extrafiles/screensavers/qml_scripts/Warp.qml
@@ -0,0 +1,57 @@
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+
+Rectangle {
+ id : canvas
+ anchors.fill: parent
+ color: "black"
+
+ // CREATE STARFIELD
+ Repeater {
+ model: Math.round(Math.random()*canvas.width/10)+500
+ Rectangle {
+ parent: canvas
+ x: Math.round(Math.random()*canvas.width)
+ y: Math.round(Math.random()*canvas.height)
+ width: Math.round(Math.random()*3)+3
+ height: width
+ radius: width/2
+ color: "white"
+ }
+ } //end of Repeater
+
+ // NOW CREATE THE WARP EFFECT
+ ZoomBlur {
+ id: blur
+ anchors.fill: canvas
+ source: canvas
+ samples: 24
+ length: canvas.width / 20
+ horizontalOffset: 0
+ verticalOffset: 0
+
+ Behavior on horizontalOffset{
+ NumberAnimation{
+ duration: 3000
+ }
+ }
+ Behavior on verticalOffset{
+ NumberAnimation{
+ duration: 3000
+ }
+ }
+ } //end of zoom blur
+
+ Timer {
+ interval: 5
+ repeat: true
+ running: true
+ property bool starting: true
+ onTriggered: {
+ if(starting){ interval = 3010; starting = false; }
+ blur.horizontalOffset = (Math.random()*canvas.width/4) - (canvas.width/8)
+ blur.verticalOffset = (Math.random()*canvas.height/4) - (canvas.height/8)
+ }
+ } //end of timer
+
+} //end of canvas rectangle
diff --git a/src-qt5/src-cpp/plugins-screensaver.cpp b/src-qt5/src-cpp/plugins-screensaver.cpp
index e9ac1330..75e93c9d 100644
--- a/src-qt5/src-cpp/plugins-screensaver.cpp
+++ b/src-qt5/src-cpp/plugins-screensaver.cpp
@@ -61,7 +61,7 @@ if(ok){
QJsonArray tmpA = data.value("additional_files").toArray();
for(int i=0; i<tmpA.count(); i++){ mustexist << tmpA[i].toString(); }
QString reldir = currentfile.section("/",0,-2) + "/";
- qDebug() << "Got MustExist:" << mustexist << reldir;
+ //qDebug() << "Got MustExist:" << mustexist << reldir;
for(int i=0; i<mustexist.length() && ok; i++){
if(mustexist[i].startsWith("/")){ ok = QFile::exists(mustexist[i]); }
else { ok = QFile::exists(reldir+mustexist[i]); }
@@ -102,7 +102,7 @@ QString SSPlugin::translatedDescription(){
QUrl SSPlugin::scriptURL(){
QString exec = data.value("qml").toObject().value("exec").toString();
- qDebug() << "got exec:" << exec;
+ //qDebug() << "got exec:" << exec;
if(!exec.startsWith("/")){ exec.prepend( currentfile.section("/",0,-2)+"/" ); }
return QUrl::fromLocalFile(exec);
}
@@ -138,11 +138,11 @@ QList<SSPlugin> SSPluginSystem::findAllPlugins(bool validonly){
if(!QFile::exists(dirs[i]+REL_DIR)){ continue; }
QDir dir(dirs[i]+REL_DIR);
QStringList files = dir.entryList(QStringList() << "*.json", QDir::Files, QDir::Name);
- qDebug() << "Found Files:" << files;
+ //qDebug() << "Found Files:" << files;
for(int j=0; j<files.length(); j++){
SSPlugin tmp;
tmp.loadFile(dir.absoluteFilePath(files[j]));
- qDebug() << "Loaded File:" << files[j] << tmp.isValid();
+ //qDebug() << "Loaded File:" << files[j] << tmp.isValid();
if(!validonly || tmp.isValid()){ LIST << tmp; }
}
}
bgstack15