OSDN Git Service

fixed animation
authorkokkiemouse <kokkiemouse@gmail.com>
Sat, 10 Oct 2020 02:45:48 +0000 (11:45 +0900)
committerkokkiemouse <kokkiemouse@gmail.com>
Sat, 10 Oct 2020 02:45:48 +0000 (11:45 +0900)
Signed-off-by: kokkiemouse <kokkiemouse@gmail.com>
channels/share/airootfs/usr/share/calamares/branding/serene/show.qml

index 61ee0e2..1c2c8d6 100644 (file)
@@ -32,6 +32,15 @@ Presentation
      */
 
     // slide1
+    function switchSlides(from, to, forward) {
+
+        to.stop_animation()
+        from.visible = false
+
+        to.start_animation()
+        to.visible = true
+        return true
+    }
     Slide {
         id: slide_1
         Image {
@@ -56,11 +65,13 @@ Presentation
             wrapMode: Text.WordWrap
         }
         Rectangle{
+            id:slide_1_rect_1
             width : slide_1.width
             height: slide_1.height
             color: "#FFFFFFFF"
 
             SequentialAnimation on color{
+                id:slide_1_color_animation
                 PauseAnimation { duration:2000 }
                 ColorAnimation {
                     to  : "#00FFFFFF"
@@ -79,6 +90,7 @@ Presentation
             wrapMode: Text.WordWrap
             width: presentation.width
             SequentialAnimation on x {
+                id:slide_1_text_1_animation
                 PauseAnimation{ duration: 500 }
                 XAnimator{
                     from:-800
@@ -88,6 +100,17 @@ Presentation
                 }
             }
         }
+        function stop_animation(){
+            slide_1_color_animation.stop()
+            slide_1_rect_1.color="#FFFFFFFF"
+            text_1.x=-800
+            slide_1_text_1_animation.stop()
+        }
+        function start_animation(){
+            slide_1_color_animation.start()
+            slide_1_text_1_animation.start()
+
+        }
     }
 
     // slide2
@@ -115,11 +138,13 @@ Presentation
             wrapMode: Text.WordWrap
         }
         Rectangle{
+            id:slide_2_rect
             width : slide_2.width
             height: slide_2.height
             color: "#FFFFFFFF"
 
             SequentialAnimation on color{
+                id:slide_2_color_anim
                 PauseAnimation { duration:2000 }
                 ColorAnimation {
                     to  : "#00FFFFFF"
@@ -138,6 +163,7 @@ Presentation
             wrapMode: Text.WordWrap
             width: presentation.width
             SequentialAnimation on x {
+                id: text_2_animation
                 PauseAnimation{ duration: 500 }
                 XAnimator{
                     from:-800
@@ -147,6 +173,16 @@ Presentation
                 }
             }
         }
+        function stop_animation(){
+            text_2_animation.stop()
+            slide_2_color_anim.stop()
+            text_2.x=-800
+            slide_2_rect.color="#FFFFFFFF"
+        }
+        function start_animation(){
+            text_2_animation.start()
+            slide_2_color_anim.start()
+        }
     }
 
     // logo