Port systray away from QQC1

wilder-5.26
Volker Krause 4 years ago
parent 594bf27874
commit d0537bc5e7
  1. 28
      applets/systemtray/package/contents/ui/PlasmoidPopupsContainer.qml

@ -4,9 +4,9 @@
SPDX-License-Identifier: LGPL-2.0-or-later SPDX-License-Identifier: LGPL-2.0-or-later
*/ */
import QtQuick 2.4 import QtQuick 2.15
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Controls 1.4 import QtQuick.Controls 2.15
//needed for units //needed for units
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents3 import org.kde.plasma.components 3.0 as PlasmaComponents3
@ -55,7 +55,7 @@ StackView {
} }
} }
mainStack.replace({item: activeApplet.fullRepresentationItem, immediate: !systemTrayState.expanded, properties: {focus: true}}); mainStack.replace(activeApplet.fullRepresentationItem, {focus: true}, systemTrayState.expanded ? StackView.Transition : StackView.Immediate);
} else { } else {
mainStack.replace(emptyPage); mainStack.replace(emptyPage);
} }
@ -80,11 +80,6 @@ StackView {
id: emptyPage id: emptyPage
} }
delegate: StackViewDelegate {
id: transitioner
function transitionFinished(properties) {
properties.exitItem.opacity = 1
}
property bool goingLeft: { property bool goingLeft: {
const unFlipped = systemTrayState.oldVisualIndex < systemTrayState.newVisualIndex const unFlipped = systemTrayState.oldVisualIndex < systemTrayState.newVisualIndex
@ -94,19 +89,17 @@ StackView {
return !unFlipped return !unFlipped
} }
} }
replaceTransition: StackViewTransition { replaceEnter: Transition {
ParallelAnimation {
PropertyAnimation { PropertyAnimation {
target: enterItem id: xani
property: "x" property: "x"
from: root.vertical ? 0 : (transitioner.goingLeft ? enterItem.width : -enterItem.width) from: root.vertical ? 0 : (mainStack.goingLeft ? mainStack.width : -mainStack.width)
to: 0 to: 0
easing.type: Easing.InOutQuad easing.type: Easing.InOutQuad
duration: PlasmaCore.Units.shortDuration duration: PlasmaCore.Units.shortDuration
} }
SequentialAnimation { SequentialAnimation {
PropertyAction { PropertyAction {
target: enterItem
property: "opacity" property: "opacity"
value: 0 value: 0
} }
@ -114,7 +107,6 @@ StackView {
duration: root.vertical ? (PlasmaCore.Units.shortDuration/2) : 0 duration: root.vertical ? (PlasmaCore.Units.shortDuration/2) : 0
} }
PropertyAnimation { PropertyAnimation {
target: enterItem
property: "opacity" property: "opacity"
from: 0 from: 0
to: 1 to: 1
@ -123,17 +115,15 @@ StackView {
} }
} }
} }
ParallelAnimation { replaceExit: Transition {
PropertyAnimation { PropertyAnimation {
target: exitItem
property: "x" property: "x"
from: 0 from: 0
to: root.vertical ? 0 : (transitioner.goingLeft ? -exitItem.width : exitItem.width) to: root.vertical ? 0 : (mainStack.goingLeft ? -mainStack.width : mainStack.width)
easing.type: Easing.InOutQuad easing.type: Easing.InOutQuad
duration: PlasmaCore.Units.shortDuration duration: PlasmaCore.Units.shortDuration
} }
PropertyAnimation { PropertyAnimation {
target: exitItem
property: "opacity" property: "opacity"
from: 1 from: 1
to: 0 to: 0
@ -142,5 +132,3 @@ StackView {
} }
} }
} }
}
}

Loading…
Cancel
Save