mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +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 {
|
||||
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: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue