Browse Source

Move unlicensed spam out of main window

Donald Carr 8 years ago
parent
commit
1579425ab1
5 changed files with 48 additions and 49 deletions
  1. 5 48
      qml/main.qml
  2. 1 0
      qml/qmldir
  3. 2 1
      resources/resources.qrc
  4. 40 0
      resources/unlicensed/Unlicensed.qml
  5. 0 0
      resources/unlicensed/unlicensed.png

+ 5 - 48
qml/main.qml

@@ -156,6 +156,7 @@ Window {
 
         Loader {
             id: artViewLoader
+            z: 1
             anchors.fill: parent
         }
 
@@ -213,6 +214,10 @@ Window {
             if (globalSettings.backdrop != "") {
                 Qt.createQmlObject(globalSettings.backdrop + ' { anchors.fill: parent}', root)
             }
+
+            if (globalSettings.unlicensed) {
+                Qt.createQmlObject('Unlicensed { z: 2 }', root)
+            }
         }
     }
 
@@ -282,45 +287,7 @@ Window {
         showTimer.start()
     }
 
-    Item {
-        z: 1
-        visible: d.displayUnlicensed
-        anchors { right: parent.right; bottom: parent.bottom }
-        width: appWindow.width/2
-        height: appWindow.height/2
 
-        Text {
-            z: 1
-            color: "white"
-            font.pointSize: 60
-            anchors { horizontalCenter: parent.horizontalCenter; top: parent.top }
-            text: "UNLICENCED"
-        }
-
-        Image {
-            id: mug
-            property int revolutions: 1000000
-            fillMode: Image.PreserveAspectFit
-            height: appWindow.height/2
-            anchors { centerIn: parent }
-            source: "qrc:///unlicensed.png"
-            RotationAnimator {
-                   target: mug;
-                   from: 0;
-                   to: 360*mug.revolutions
-                   duration: 2000*mug.revolutions
-                   running: mug.visible
-               }
-        }
-
-        Text {
-            z: 1
-            color: "white"
-            font.pointSize: 60
-            anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom }
-            text: "COPY"
-        }
-    }
 
     Timer {
         id: showTimer
@@ -333,16 +300,6 @@ Window {
         }
     }
 
-    Timer {
-        running: true
-        interval: 60*1000
-        onTriggered: {
-            if (globalSettings.unlicensed) {
-                d.displayUnlicensed = true
-            }
-        }
-    }
-
     FPSMonitor {
         anchors { top: parent.top; right: parent.right }
     }

+ 1 - 0
qml/qmldir

@@ -8,3 +8,4 @@ RectangleBoxBody 1.0 physics/RectangleBoxBody.qml
 BoxBody 1.0 physics/BoxBody.qml
 FPSMonitor 1.0 widget/FPSMonitor.qml
 BackgroundSwirls 1.0 3rdparty/backdrops/qml-presentation-visuals/BackgroundSwirls.qml
+Unlicensed 1.0 unlicensed/Unlicensed.qml

+ 2 - 1
resources/resources.qrc

@@ -1,6 +1,7 @@
 <RCC>
     <qresource prefix="/">
-        <file>unlicensed.png</file>
+        <file>unlicensed/unlicensed.png</file>
+        <file>unlicensed/Unlicensed.qml</file>
         <file>qt_logo_green_rgb.png</file>
         <file>Monty_python_foot.png</file>
         <file>shaders/billboard.fsh</file>

+ 40 - 0
resources/unlicensed/Unlicensed.qml

@@ -0,0 +1,40 @@
+import QtQuick 2.4
+
+Item {
+    z: 1
+    anchors { right: parent.right; bottom: parent.bottom }
+    width: appWindow.width/2
+    height: appWindow.height/2
+
+    Text {
+        z: 1
+        color: "white"
+        font.pointSize: 60
+        anchors { horizontalCenter: parent.horizontalCenter; top: parent.top }
+        text: "UNLICENCED"
+    }
+
+    Image {
+        id: mug
+        property int revolutions: 1000000
+        fillMode: Image.PreserveAspectFit
+        height: appWindow.height/2
+        anchors { centerIn: parent }
+        source: "unlicensed.png"
+        RotationAnimator {
+               target: mug;
+               from: 0;
+               to: 360*mug.revolutions
+               duration: 2000*mug.revolutions
+               running: mug.visible
+           }
+    }
+
+    Text {
+        z: 1
+        color: "white"
+        font.pointSize: 60
+        anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom }
+        text: "COPY"
+    }
+}

+ 0 - 0
resources/unlicensed.png → resources/unlicensed/unlicensed.png