Verified Commit 22e03887 authored by Fushan Wen's avatar Fushan Wen
Browse files

applets/systray: don't clear old applet before transition

Instead, set opacity:0 and x:0 to avoid invisible applets, because
during a transition the two properties will be changed by the animation.

CCBUG: 459419
CCBUG: 459421

(cherry picked from commit f7fe49f3)
parent 181a7f35
......@@ -32,10 +32,6 @@ StackView {
property int footerHeight: mergeFooters ? activeApplet.fullRepresentationItem.footer.height : 0
onActiveAppletChanged: {
if (currentItem !== null) {
clear();
}
mainStack.appletHasHeading = false
mainStack.appletHasFooter = false
if (activeApplet != null) {
......@@ -64,13 +60,16 @@ StackView {
unFlipped = !unFlipped;
}
mainStack.push(activeApplet.fullRepresentationItem, {
const isTransitionEnabled = systemTrayState.expanded;
(mainStack.empty ? mainStack.push : mainStack.replace)(activeApplet.fullRepresentationItem, {
"width": Qt.binding(() => mainStack.width),
"height": Qt.binding(() => mainStack.height),
"x": 0,
"focus": true,
"opacity": 1,
"KeyNavigation.up": mainStack.KeyNavigation.up,
"KeyNavigation.backtab": mainStack.KeyNavigation.backtab,
}, systemTrayState.expanded ? (unFlipped ? StackView.PushTransition : StackView.PopTransition) : StackView.Immediate);
}, isTransitionEnabled ? (unFlipped ? StackView.PushTransition : StackView.PopTransition) : StackView.Immediate);
} else {
mainStack.clear();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment