Warning, /plasma/plasma-pa/applet/contents/ui/HorizontalStackView.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * SPDX-FileCopyrightText: 2022 Noah Davis <noahadvs@gmail.com>
0003  * SPDX-License-Identifier: LGPL-2.0-or-later
0004  */
0005 
0006 import QtQuick 2.15
0007 import QtQuick.Templates 2.15 as T
0008 import org.kde.plasma.core 2.0 as PlasmaCore
0009 
0010 T.StackView {
0011     id: root
0012     property bool reverseTransitions: false
0013     property bool movementTransitionsEnabled: true
0014     implicitWidth: implicitContentWidth + leftPadding + rightPadding
0015     implicitHeight: implicitContentHeight + topPadding + bottomPadding
0016     clip: busy
0017     contentItem: currentItem
0018     Accessible.ignored: true
0019     popEnter: enterTransition
0020     popExit: exitTransition
0021     pushEnter: enterTransition
0022     pushExit: exitTransition
0023     replaceEnter: enterTransition
0024     replaceExit: exitTransition
0025     // Using NumberAnimation instead of XAnimator because the latter wasn't always smooth enough
0026     Transition {
0027         id: enterTransition
0028         NumberAnimation {
0029             properties: "x"
0030             from: (root.reverseTransitions ? -0.5 : 0.5) * (root.mirrored ? -1 : 1) * -root.width
0031             to: 0
0032             duration: root.movementTransitionsEnabled ? PlasmaCore.Units.longDuration : 0
0033             easing.type: Easing.InOutQuad // Matching TabBar's ListView so that animations move in sync
0034         }
0035         NumberAnimation { property: "opacity"
0036             from: 0.0
0037             to: 1.0
0038             duration: PlasmaCore.Units.longDuration
0039             easing.type: Easing.InOutQuad
0040         }
0041     }
0042     Transition {
0043         id: exitTransition
0044         NumberAnimation {
0045             property: "x"
0046             from: 0
0047             to: (root.reverseTransitions ? -0.5 : 0.5) * (root.mirrored ? -1 : 1) * root.width
0048             duration: root.movementTransitionsEnabled ? PlasmaCore.Units.longDuration : 0
0049             easing.type: Easing.InOutQuad
0050         }
0051         NumberAnimation {
0052             property: "opacity"
0053             from: 1.0
0054             to: 0.0
0055             duration: PlasmaCore.Units.longDuration
0056             easing.type: Easing.InOutQuad
0057         }
0058     }
0059 }