Warning, /frameworks/qqc2-desktop-style/org.kde.desktop/StackView.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2017 The Qt Company Ltd.
0003     SPDX-FileCopyrightText: 2022 Fushan Wen <qydwhotmail@gmail.com>
0004 
0005     SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-or-later
0006 */
0007 
0008 import QtQuick 2.15
0009 import QtQuick.Controls 2.15
0010 import QtQuick.Templates 2.15 as T
0011 
0012 import org.kde.kirigami 2.20 as Kirigami
0013 
0014 T.StackView {
0015     id: control
0016 
0017     // Using NumberAnimation instead of XAnimator because the latter wasn't always smooth enough.
0018     pushEnter: Transition {
0019         NumberAnimation {
0020             property: "x"
0021             from: (control.mirrored ? -0.5 : 0.5) * control.width
0022             to: 0
0023             duration: Kirigami.Units.longDuration
0024             easing.type: Easing.OutCubic
0025         }
0026         NumberAnimation {
0027             property: "opacity"
0028             from: 0.0; to: 1.0
0029             duration: Kirigami.Units.longDuration
0030             easing.type: Easing.OutCubic
0031         }
0032     }
0033     pushExit: Transition {
0034         NumberAnimation {
0035             property: "x"
0036             from: 0
0037             to: (control.mirrored ? -0.5 : 0.5) * -control.width
0038             duration: Kirigami.Units.longDuration
0039             easing.type: Easing.OutCubic
0040         }
0041         NumberAnimation {
0042             property: "opacity"
0043             from: 1.0; to: 0.0
0044             duration: Kirigami.Units.longDuration
0045             easing.type: Easing.OutCubic
0046         }
0047     }
0048     popEnter: Transition {
0049         NumberAnimation {
0050             property: "x"
0051             from: (control.mirrored ? -0.5 : 0.5) * -control.width
0052             to: 0
0053             duration: Kirigami.Units.longDuration
0054             easing.type: Easing.OutCubic
0055         }
0056         NumberAnimation {
0057             property: "opacity"
0058             from: 0.0; to: 1.0
0059             duration: Kirigami.Units.longDuration
0060             easing.type: Easing.OutCubic
0061         }
0062     }
0063     popExit: Transition {
0064         NumberAnimation {
0065             property: "x"
0066             from: 0
0067             to: (control.mirrored ? -0.5 : 0.5) * control.width
0068             duration: Kirigami.Units.longDuration
0069             easing.type: Easing.OutCubic
0070         }
0071         NumberAnimation {
0072             property: "opacity"
0073             from: 1.0; to: 0.0
0074             duration: Kirigami.Units.longDuration
0075             easing.type: Easing.OutCubic
0076         }
0077     }
0078     replaceEnter: Transition {
0079         NumberAnimation {
0080             property: "x"
0081             from: (control.mirrored ? -0.5 : 0.5) * control.width
0082             to: 0
0083             duration: Kirigami.Units.longDuration
0084             easing.type: Easing.OutCubic
0085         }
0086         NumberAnimation {
0087             property: "opacity"
0088             from: 0.0; to: 1.0
0089             duration: Kirigami.Units.longDuration
0090             easing.type: Easing.OutCubic
0091         }
0092     }
0093     replaceExit: Transition {
0094         NumberAnimation {
0095             property: "x"
0096             from: 0
0097             to: (control.mirrored ? -0.5 : 0.5) * -control.width
0098             duration: Kirigami.Units.longDuration
0099             easing.type: Easing.OutCubic
0100         }
0101         NumberAnimation {
0102             property: "opacity"
0103             from: 1.0; to: 0.0
0104             duration: Kirigami.Units.longDuration
0105             easing.type: Easing.OutCubic
0106         }
0107     }
0108 }