mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-03 10:14:45 +00:00
solve loop when a new activity is created
T10009
This commit is contained in:
parent
8833d59c6d
commit
658312f2f1
2 changed files with 16 additions and 4 deletions
|
|
@ -67,8 +67,9 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
delegate: MouseArea {
|
delegate: MouseArea {
|
||||||
id: delegate
|
id: delegate
|
||||||
|
preventStealing: true
|
||||||
drag {
|
drag {
|
||||||
target: listView.count > 0 && !model.current? delegate : null
|
target: listView.count > 0 ? delegate : null
|
||||||
axis: Drag.XAxis
|
axis: Drag.XAxis
|
||||||
}
|
}
|
||||||
PlasmaComponents.Highlight {
|
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.kquickcontrolsaddons 2.0
|
||||||
import org.kde.activities 0.1 as Activities
|
import org.kde.activities 0.1 as Activities
|
||||||
import "../components"
|
import "../components"
|
||||||
|
import org.kde.kirigami 2.5 as Kirigami
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
@ -110,18 +111,27 @@ Item {
|
||||||
x + width < -activitiesLayout.x + activitiesView.width))
|
x + width < -activitiesLayout.x + activitiesView.width))
|
||||||
readonly property bool currentActivity: root.containment && model.current
|
readonly property bool currentActivity: root.containment && model.current
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
inViewportChanged();
|
||||||
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: activitiesView
|
target: activitiesView
|
||||||
onCurrentIndexChanged: {
|
onCurrentIndexChanged: {
|
||||||
if (activitiesView.currentIndex == index) {
|
if (activitiesView.currentIndex == index && !model.current) {
|
||||||
activityModel.setCurrentActivity(model.id, function(){
|
activityModel.setCurrentActivity(model.id, function() {
|
||||||
|
inViewportChanged();
|
||||||
mainDelegate.containment.parent = mainDelegate;
|
mainDelegate.containment.parent = mainDelegate;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onFlickEnded: activitiesView.movementEnded()
|
onFlickEnded: activitiesView.movementEnded()
|
||||||
}
|
}
|
||||||
|
Connections {
|
||||||
|
target: desktop
|
||||||
|
onCandidateContainmentsChanged: {
|
||||||
|
inViewportChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
onInViewportChanged: {
|
onInViewportChanged: {
|
||||||
if (inViewport && !mainDelegate.containment) {
|
if (inViewport && !mainDelegate.containment) {
|
||||||
mainDelegate.containment = desktop.candidateContainments[model.id];
|
mainDelegate.containment = desktop.candidateContainments[model.id];
|
||||||
|
|
@ -129,6 +139,7 @@ Item {
|
||||||
containmentNextActivityPreview = containment;
|
containmentNextActivityPreview = containment;
|
||||||
mainDelegate.containment.parent = mainDelegate;
|
mainDelegate.containment.parent = mainDelegate;
|
||||||
mainDelegate.containment.anchors.fill = mainDelegate;
|
mainDelegate.containment.anchors.fill = mainDelegate;
|
||||||
|
mainDelegate.containment.visible = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onCurrentActivityChanged: {
|
onCurrentActivityChanged: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue