Commit 84eb6584 authored by Fushan Wen's avatar Fushan Wen
Browse files

containments/panel: fix applet order in new panel

`indexAtCoordinates` returns 0 when x < 0 or y < 0 in the while loop.
But when a new preset panel is added, `childAt` will not be able to
find any applet because they are not initialized yet, so the new position
for an applet is always 0, which results in reversed order of applets.
parent dad8082e
Pipeline #177398 passed with stage
in 2 minutes and 45 seconds
......@@ -111,7 +111,8 @@ function indexAtCoordinates(x, y) {
} else {
y -= layout.columnSpacing
}
if (x < 0 || y < 0) return 0;
// childAt won't find any applet when adding a new preset panel
if (x < 0 || y < 0) return appletsModel.count;
child = layout.childAt(x, y);
}
if ((plasmoid.formFactor === 3 && y < child.y + child.height/2) ||
......
Supports Markdown
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