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
*/
import QtQuick 2.15
import QtQuick 2.4
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.15
import QtQuick.Controls 1.4
//needed for units
import org.kde.plasma.core 2.0 as PlasmaCore
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 {
mainStack.replace(emptyPage);
}
@ -80,55 +80,67 @@ StackView {
id: emptyPage
}
property bool goingLeft: {
const unFlipped = systemTrayState.oldVisualIndex < systemTrayState.newVisualIndex
if (Qt.application.layoutDirection == Qt.LeftToRight) {
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
delegate: StackViewDelegate {
id: transitioner
function transitionFinished(properties) {
properties.exitItem.opacity = 1
}
SequentialAnimation {
PropertyAction {
property: "opacity"
value: 0
property bool goingLeft: {
const unFlipped = systemTrayState.oldVisualIndex < systemTrayState.newVisualIndex
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 {
property: "opacity"
from: 0
to: 1
easing.type: Easing.InOutQuad
duration: (PlasmaCore.Units.shortDuration/2)
ParallelAnimation {
PropertyAnimation {
target: exitItem
property: "x"
from: 0
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