Commit 658312f2 authored by Marco Martin's avatar Marco Martin

solve loop when a new activity is created

T10009
parent 8833d59c
......@@ -67,8 +67,9 @@ ColumnLayout {
}
delegate: MouseArea {
id: delegate
preventStealing: true
drag {
target: listView.count > 0 && !model.current? delegate : null
target: listView.count > 0 ? delegate : null
axis: Drag.XAxis
}
PlasmaComponents.Highlight {
......
......@@ -28,6 +28,7 @@ import org.kde.plasma.workspace.components 2.0 as PlasmaWorkspace
import org.kde.kquickcontrolsaddons 2.0
import org.kde.activities 0.1 as Activities
import "../components"
import org.kde.kirigami 2.5 as Kirigami
Item {
id: root
......@@ -110,18 +111,27 @@ Item {
x + width < -activitiesLayout.x + activitiesView.width))
readonly property bool currentActivity: root.containment && model.current
Component.onCompleted: {
inViewportChanged();
}
Connections {
target: activitiesView
onCurrentIndexChanged: {
if (activitiesView.currentIndex == index) {
activityModel.setCurrentActivity(model.id, function(){
if (activitiesView.currentIndex == index && !model.current) {
activityModel.setCurrentActivity(model.id, function() {
inViewportChanged();
mainDelegate.containment.parent = mainDelegate;
});
}
}
onFlickEnded: activitiesView.movementEnded()
}
Connections {
target: desktop
onCandidateContainmentsChanged: {
inViewportChanged();
}
}
onInViewportChanged: {
if (inViewport && !mainDelegate.containment) {
mainDelegate.containment = desktop.candidateContainments[model.id];
......@@ -129,6 +139,7 @@ Item {
containmentNextActivityPreview = containment;
mainDelegate.containment.parent = mainDelegate;
mainDelegate.containment.anchors.fill = mainDelegate;
mainDelegate.containment.visible = true;
}
}
onCurrentActivityChanged: {
......
Markdown is supported
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