minecraft-linux / mcpelauncher-ui-qt

GNU General Public License v3.0
8 stars 13 forks source link

Add some ui animations #39

Closed devendrn closed 5 months ago

devendrn commented 5 months ago

Please don't merge without testing on qt5

https://github.com/minecraft-linux/mcpelauncher-ui-qt/assets/91605478/100bdef8-67b9-4394-a9e7-a2d30f773ace

https://github.com/minecraft-linux/mcpelauncher-ui-qt/assets/91605478/0bee99ea-476b-4a57-9850-907dabb2aae5

https://github.com/minecraft-linux/mcpelauncher-ui-qt/assets/91605478/cdffe4e7-7dae-4efd-9bdf-cce4ec2477a0

https://github.com/minecraft-linux/mcpelauncher-ui-qt/assets/91605478/98582c40-e3a5-4120-881e-33ef90e46499

https://github.com/minecraft-linux/mcpelauncher-ui-qt/assets/91605478/c6efec44-23b3-4be7-be7d-238688cf2729

https://github.com/minecraft-linux/mcpelauncher-ui-qt/assets/91605478/1f9e50f2-59c3-4c74-b4b2-d4d9778e7922

Other changes include:

I've tried to keep the animation duration within 60 - 250ms (time to reach 90% final state). But it might require some more tweaking. If you think some of these animations impact the user experience negatively, I can remove them.

ChristopherHX commented 5 months ago

onFinished is not supported in qt5.9, added in qt5.12. Otherwise

diff --git a/qml/ThemedControls/AnimatedStackLayout.qml b/qml/ThemedControls/AnimatedStackLayout.qml
index 52910f7..16a8620 100644
--- a/qml/ThemedControls/AnimatedStackLayout.qml
+++ b/qml/ThemedControls/AnimatedStackLayout.qml
@@ -1,5 +1,5 @@
-import QtQuick
-import QtQuick.Layouts
+import QtQuick 2.9
+import QtQuick.Layouts 1.3

 StackLayout {
     id: root
@@ -44,7 +44,7 @@ StackLayout {
             }

             onStarted: previousItem.visible = true
-            onFinished: previousItem.visible = false
+            onStopped: previousItem.visible = false
         }
     }