Revert "Port systray away from QQC1"

This reverts commit d0537bc5e7.

This breaks the layout and has to be reverted for now, pending a
non-regressing port.
wilder-5.26
Nate Graham 4 years ago
parent d72310322f
commit c18d69c26a
  1. 108
      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.15 import QtQuick 2.4
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Controls 2.15 import QtQuick.Controls 1.4
//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(activeApplet.fullRepresentationItem, {focus: true}, systemTrayState.expanded ? StackView.Transition : StackView.Immediate); mainStack.replace({item: activeApplet.fullRepresentationItem, immediate: !systemTrayState.expanded, properties: {focus: true}});
} else { } else {
mainStack.replace(emptyPage); mainStack.replace(emptyPage);
} }
@ -80,55 +80,67 @@ StackView {
id: emptyPage id: emptyPage
} }
property bool goingLeft: { delegate: StackViewDelegate {
const unFlipped = systemTrayState.oldVisualIndex < systemTrayState.newVisualIndex id: transitioner
function transitionFinished(properties) {
if (Qt.application.layoutDirection == Qt.LeftToRight) { properties.exitItem.opacity = 1
return unFlipped
} else {
return !unFlipped
}
}
replaceEnter: Transition {
PropertyAnimation {
id: xani
property: "x"
from: root.vertical ? 0 : (mainStack.goingLeft ? mainStack.width : -mainStack.width)
to: 0
easing.type: Easing.InOutQuad
duration: PlasmaCore.Units.shortDuration
} }
SequentialAnimation { property bool goingLeft: {
PropertyAction { const unFlipped = systemTrayState.oldVisualIndex < systemTrayState.newVisualIndex
property: "opacity"
value: 0 if (Qt.application.layoutDirection == Qt.LeftToRight) {
return unFlipped
} else {
return !unFlipped
} }
PauseAnimation { }
duration: root.vertical ? (PlasmaCore.Units.shortDuration/2) : 0 replaceTransition: StackViewTransition {
ParallelAnimation {
PropertyAnimation {
target: enterItem
property: "x"
from: root.vertical ? 0 : (transitioner.goingLeft ? enterItem.width : -enterItem.width)
to: 0
easing.type: Easing.InOutQuad
duration: PlasmaCore.Units.shortDuration
}
SequentialAnimation {
PropertyAction {
target: enterItem
property: "opacity"
value: 0
}
PauseAnimation {
duration: root.vertical ? (PlasmaCore.Units.shortDuration/2) : 0
}
PropertyAnimation {
target: enterItem
property: "opacity"
from: 0
to: 1
easing.type: Easing.InOutQuad
duration: (PlasmaCore.Units.shortDuration/2)
}
}
} }
PropertyAnimation { ParallelAnimation {
property: "opacity" PropertyAnimation {
from: 0 target: exitItem
to: 1 property: "x"
easing.type: Easing.InOutQuad from: 0
duration: (PlasmaCore.Units.shortDuration/2) to: root.vertical ? 0 : (transitioner.goingLeft ? -exitItem.width : exitItem.width)
easing.type: Easing.InOutQuad
duration: PlasmaCore.Units.shortDuration
}
PropertyAnimation {
target: exitItem
property: "opacity"
from: 1
to: 0
easing.type: Easing.InOutQuad
duration: PlasmaCore.Units.shortDuration/2
}
} }
} }
} }
replaceExit: Transition {
PropertyAnimation {
property: "x"
from: 0
to: root.vertical ? 0 : (mainStack.goingLeft ? -mainStack.width : mainStack.width)
easing.type: Easing.InOutQuad
duration: PlasmaCore.Units.shortDuration
}
PropertyAnimation {
property: "opacity"
from: 1
to: 0
easing.type: Easing.InOutQuad
duration: PlasmaCore.Units.shortDuration/2
}
}
} }

Loading…
Cancel
Save