소스 검색

Добавлено состояние скрытой кнопки

Denis V. Dedkov 1 개월 전
부모
커밋
9c7a6ad472
1개의 변경된 파일과 33개의 추가작업 그리고 0개의 파일을 삭제
  1. 33 0
      MenuBackButton.qml

+ 33 - 0
MenuBackButton.qml

@@ -70,15 +70,48 @@ Item {
             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() }
+        },
+
+        State {
+            name: "hidden"
+            PropertyChanges { target: ma; enabled: false }
+            PropertyChanges { target: root; opacity: 0 }
         }
     ]
 
     transitions: [
         Transition {
+            from: "hidden"; to: "*"
+            SequentialAnimation
+            {
+                PropertyAction { targets: [root, bar1, bar2, bar3]; properties: "rotation, width, x, y" }
+                NumberAnimation { target: root; property: "opacity"; duration: animationDuration; easing.type: Easing.InOutQuad }
+            }
+        },
+
+        Transition {
+            from: "*"; to: "hidden"
+            SequentialAnimation
+            {
+                NumberAnimation { target: root; property: "opacity"; duration: 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 }
+        },
+
+        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 }
         }
     ]
 }