StackView.qml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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.Imagine
  7. import QtQuick.Controls.Imagine.impl
  8. T.StackView {
  9. id: control
  10. implicitWidth: implicitBackgroundWidth
  11. implicitHeight: implicitBackgroundHeight
  12. topPadding: background ? background.topPadding : 0
  13. leftPadding: background ? background.leftPadding : 0
  14. rightPadding: background ? background.rightPadding : 0
  15. bottomPadding: background ? background.bottomPadding : 0
  16. topInset: background ? -background.topInset || 0 : 0
  17. leftInset: background ? -background.leftInset || 0 : 0
  18. rightInset: background ? -background.rightInset || 0 : 0
  19. bottomInset: background ? -background.bottomInset || 0 : 0
  20. popEnter: Transition {
  21. XAnimator { from: (control.mirrored ? -1 : 1) * -control.width; to: 0; duration: 400; easing.type: Easing.OutCubic }
  22. }
  23. popExit: Transition {
  24. XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * control.width; duration: 400; easing.type: Easing.OutCubic }
  25. }
  26. pushEnter: Transition {
  27. XAnimator { from: (control.mirrored ? -1 : 1) * control.width; to: 0; duration: 400; easing.type: Easing.OutCubic }
  28. }
  29. pushExit: Transition {
  30. XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * -control.width; duration: 400; easing.type: Easing.OutCubic }
  31. }
  32. replaceEnter: Transition {
  33. XAnimator { from: (control.mirrored ? -1 : 1) * control.width; to: 0; duration: 400; easing.type: Easing.OutCubic }
  34. }
  35. replaceExit: Transition {
  36. XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * -control.width; duration: 400; easing.type: Easing.OutCubic }
  37. }
  38. background: NinePatchImage {
  39. source: Imagine.url + "stackview-background"
  40. NinePatchImageSelector on source {
  41. states: [
  42. {"disabled": !control.enabled},
  43. {"mirrored": control.mirrored}
  44. ]
  45. }
  46. }
  47. }