StackView.qml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // Copyright (C) 2017 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
  3. // Qt-Security score:significant reason:default
  4. import QtQuick
  5. import QtQuick.Templates as T
  6. import QtQuick.Controls.Material
  7. T.StackView {
  8. id: control
  9. component LineAnimation: NumberAnimation {
  10. duration: 200
  11. easing.type: Easing.OutCubic
  12. }
  13. component FadeIn: LineAnimation {
  14. property: "opacity"
  15. from: 0.0
  16. to: 1.0
  17. }
  18. component FadeOut: LineAnimation {
  19. property: "opacity"
  20. from: 1.0
  21. to: 0.0
  22. }
  23. popEnter: Transition {
  24. // slide_in_left
  25. LineAnimation { property: "x"; from: (control.mirrored ? -0.5 : 0.5) * -control.width; to: 0 }
  26. FadeIn {}
  27. }
  28. popExit: Transition {
  29. // slide_out_right
  30. LineAnimation { property: "x"; from: 0; to: (control.mirrored ? -0.5 : 0.5) * control.width }
  31. FadeOut {}
  32. }
  33. pushEnter: Transition {
  34. // slide_in_right
  35. LineAnimation { property: "x"; from: (control.mirrored ? -0.5 : 0.5) * control.width; to: 0 }
  36. FadeIn {}
  37. }
  38. pushExit: Transition {
  39. // slide_out_left
  40. LineAnimation { property: "x"; from: 0; to: (control.mirrored ? -0.5 : 0.5) * -control.width }
  41. FadeOut {}
  42. }
  43. replaceEnter: Transition {
  44. // slide_in_right
  45. LineAnimation { property: "x"; from: (control.mirrored ? -0.5 : 0.5) * control.width; to: 0 }
  46. FadeIn {}
  47. }
  48. replaceExit: Transition {
  49. // slide_out_left
  50. LineAnimation { property: "x"; from: 0; to: (control.mirrored ? -0.5 : 0.5) * -control.width }
  51. FadeOut {}
  52. }
  53. }