|
| 1 | +// Copyright (c) 2024 The Bitcoin Core developers |
| 2 | +// Distributed under the MIT software license, see the accompanying |
| 3 | +// file COPYING or http://www.opensource.org/licenses/mit-license.php. |
| 4 | + |
| 5 | +import QtQuick 2.15 |
| 6 | +import QtQuick.Controls 2.15 |
| 7 | + |
| 8 | +StackView { |
| 9 | + property bool vertical: false |
| 10 | + |
| 11 | + pushEnter: Transition { |
| 12 | + NumberAnimation { |
| 13 | + property: vertical ? "y" : "x" |
| 14 | + from: vertical ? parent.height : parent.width |
| 15 | + to: 0 |
| 16 | + duration: 400 |
| 17 | + easing.type: Easing.Bezier |
| 18 | + easing.bezierCurve: [0.5, 0.0, 0.2, 1.0] |
| 19 | + } |
| 20 | + } |
| 21 | + pushExit: Transition { |
| 22 | + NumberAnimation { |
| 23 | + property: vertical ? "y" : "x" |
| 24 | + from: 0 |
| 25 | + to: vertical ? -parent.height : -parent.width |
| 26 | + duration: 400 |
| 27 | + easing.type: Easing.Bezier |
| 28 | + easing.bezierCurve: [0.5, 0.0, 0.2, 1.0] |
| 29 | + } |
| 30 | + } |
| 31 | + popEnter: Transition { |
| 32 | + NumberAnimation { |
| 33 | + property: vertical ? "y" : "x" |
| 34 | + from: vertical ? -parent.height : -parent.width |
| 35 | + to: 0 |
| 36 | + duration: 400 |
| 37 | + easing.type: Easing.Bezier |
| 38 | + easing.bezierCurve: [0.5, 0.0, 0.2, 1.0] |
| 39 | + } |
| 40 | + } |
| 41 | + popExit: Transition { |
| 42 | + NumberAnimation { |
| 43 | + property: vertical ? "y" : "x" |
| 44 | + from: 0 |
| 45 | + to: vertical ? parent.height : parent.width |
| 46 | + duration: 400 |
| 47 | + easing.type: Easing.Bezier |
| 48 | + easing.bezierCurve: [0.5, 0.0, 0.2, 1.0] |
| 49 | + } |
| 50 | + } |
| 51 | +} |
0 commit comments