mirror of
https://github.com/KDE/latte-dock.git
synced 2025-03-23 02:50:12 +03:00
improve heuristic of neighbour tasks
This commit is contained in:
parent
69ce4b4e02
commit
515384dd48
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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<tasks.length; ++i){
|
||||
var task = tasks[i];
|
||||
|
||||
if (task.lastValidIndex === position) {
|
||||
if (task.lastValidIndex === position
|
||||
|| (task.lastValidIndex === -1 && task.itemIndex === position )) {
|
||||
return task;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user