Просмотр исходного кода

Исправлены предупреждения линтера

Denis V. Dedkov 1 месяц назад
Родитель
Сommit
61864c2096
1 измененных файлов с 21 добавлено и 18 удалено
  1. 21 18
      MenuBackButton.qml

+ 21 - 18
MenuBackButton.qml

@@ -60,22 +60,29 @@ Item {
     states: [
         State {
             name: "menu"
-            PropertyChanges { target: ma; onClicked: root.clicked() }
+            PropertyChanges { ma.onClicked: root.clicked() }
         },
 
         State {
             name: "back"
-            PropertyChanges { target: root; rotation: 180 }
-            PropertyChanges { target: bar1; rotation: 45; width: root.iconHeight / 3 * 2; x: root.iconMarigns + root.iconHeight / 2; y: root.iconMarigns + root.iconHeight / 4 }
-            PropertyChanges { target: bar2; width: root.iconHeight / 6 * 5 + 1; x: root.iconMarigns + root.iconHeight / 9 }
-            PropertyChanges { target: bar3; rotation: -45; width: root.iconHeight / 3 * 2; x: root.iconMarigns + root.iconHeight / 2; y: root.iconMarigns + root.iconHeight / 3 * 2 }
-            PropertyChanges { target: ma; onClicked: root.back() }
+            PropertyChanges { root.rotation: 180 }
+            PropertyChanges { bar1.rotation: 45;
+                              bar1.width: root.iconHeight / 3 * 2;
+                              bar1.x: root.iconMarigns + root.iconHeight / 2;
+                              bar1.y: root.iconMarigns + root.iconHeight / 4 }
+            PropertyChanges { bar2.width: root.iconHeight / 6 * 5 + 1;
+                              bar2.x: root.iconMarigns + root.iconHeight / 9 }
+            PropertyChanges { bar3.rotation: -45;
+                              bar3.width: root.iconHeight / 3 * 2;
+                              bar3.x: root.iconMarigns + root.iconHeight / 2;
+                              bar3.y: root.iconMarigns + root.iconHeight / 3 * 2 }
+            PropertyChanges { ma.onClicked: root.back() }
         },
 
         State {
             name: "hidden"
-            PropertyChanges { target: ma; enabled: false }
-            PropertyChanges { target: root; opacity: 0 }
+            PropertyChanges { ma.enabled: false }
+            PropertyChanges { root.opacity: 0 }
         }
     ]
 
@@ -85,7 +92,7 @@ Item {
             SequentialAnimation
             {
                 PropertyAction { targets: [root, bar1, bar2, bar3]; properties: "rotation, width, x, y" }
-                NumberAnimation { target: root; property: "opacity"; duration: animationDuration; easing.type: Easing.InOutQuad }
+                NumberAnimation { target: root; property: "opacity"; duration: root.animationDuration; easing.type: Easing.InOutQuad }
             }
         },
 
@@ -93,25 +100,21 @@ Item {
             from: "*"; to: "hidden"
             SequentialAnimation
             {
-                NumberAnimation { target: root; property: "opacity"; duration: animationDuration; easing.type: Easing.InOutQuad }
+                NumberAnimation { target: root; property: "opacity"; duration: root.animationDuration; easing.type: Easing.InOutQuad }
                 PropertyAction { targets: [root, bar1, bar2, bar3]; properties: "rotation, width, x, y" }
             }
         },
 
         Transition {
             from: "menu"; to: "back"
-            RotationAnimation { target: root; direction: RotationAnimation.Clockwise; duration: animationDuration; easing.type: Easing.InOutQuad }
-            PropertyAnimation { target: bar1; properties: "rotation, width, x, y"; duration: animationDuration; easing.type: Easing.InOutQuad }
-            PropertyAnimation { target: bar2; properties: "rotation, width, x, y"; duration: animationDuration; easing.type: Easing.InOutQuad }
-            PropertyAnimation { target: bar3; properties: "rotation, width, x, y"; duration: animationDuration; easing.type: Easing.InOutQuad }
+            RotationAnimation { target: root; direction: RotationAnimation.Clockwise; duration: root.animationDuration; easing.type: Easing.InOutQuad }
+            PropertyAnimation { targets: [bar1, bar2, bar3]; properties: "rotation, width, x, y"; duration: root.animationDuration; easing.type: Easing.InOutQuad }
         },
 
         Transition {
             from: "back"; to: "menu"
-            RotationAnimation { target: root; direction: RotationAnimation.Counterclockwise; duration: animationDuration; easing.type: Easing.InOutQuad }
-            PropertyAnimation { target: bar1; properties: "rotation, width, x, y"; duration: animationDuration; easing.type: Easing.InOutQuad }
-            PropertyAnimation { target: bar2; properties: "rotation, width, x, y"; duration: animationDuration; easing.type: Easing.InOutQuad }
-            PropertyAnimation { target: bar3; properties: "rotation, width, x, y"; duration: animationDuration; easing.type: Easing.InOutQuad }
+            RotationAnimation { target: root; direction: RotationAnimation.Counterclockwise; duration: root.animationDuration; easing.type: Easing.InOutQuad }
+            PropertyAnimation { targets: [bar1, bar2, bar3]; properties: "rotation, width, x, y"; duration: root.animationDuration; easing.type: Easing.InOutQuad }
         }
     ]
 }