From 515384dd48334ffc83950b3630013be8d8bcec05 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Wed, 17 May 2017 14:40:23 +0300 Subject: [PATCH] improve heuristic of neighbour tasks --- plasmoid/package/contents/ui/TaskDelegate.qml | 2 +- plasmoid/package/contents/ui/TaskIconItem.qml | 2 +- plasmoid/package/contents/ui/main.qml | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plasmoid/package/contents/ui/TaskDelegate.qml b/plasmoid/package/contents/ui/TaskDelegate.qml index 3ba0130b9..e54028647 100644 --- a/plasmoid/package/contents/ui/TaskDelegate.qml +++ b/plasmoid/package/contents/ui/TaskDelegate.qml @@ -1647,7 +1647,7 @@ MouseArea{ //trying to fix the ListView nasty behavior //during the removal the anchoring for ListView children changes a lot - var previousTask = icList.chiltAtIndex(mainItemContainer.lastValidIndex-1); + var previousTask = icList.childAtIndex(mainItemContainer.lastValidIndex-1); if (previousTask !== undefined){ if (root.vertical) { mainItemContainer.anchors.top = previousTask.bottom; diff --git a/plasmoid/package/contents/ui/TaskIconItem.qml b/plasmoid/package/contents/ui/TaskIconItem.qml index 6fa5649dc..743895745 100644 --- a/plasmoid/package/contents/ui/TaskIconItem.qml +++ b/plasmoid/package/contents/ui/TaskIconItem.qml @@ -723,7 +723,7 @@ Item{ //trying to fix the ListView nasty behavior //during the removal the anchoring for ListView children changes a lot - var previousTask = icList.chiltAtIndex(mainItemContainer.lastValidIndex-1); + var previousTask = icList.childAtIndex(mainItemContainer.lastValidIndex-1); if (previousTask !== undefined){ if (root.vertical) { mainItemContainer.anchors.top = previousTask.bottom; diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml index 1c64b0e64..b490fb288 100644 --- a/plasmoid/package/contents/ui/main.qml +++ b/plasmoid/package/contents/ui/main.qml @@ -968,16 +968,17 @@ Item { return null; } - function chiltAtIndex(position) { + function childAtIndex(position) { var tasks = icList.contentItem.children; - if (position <=0) + if (position < 0) return; for(var i=0; i