warnings--

This commit is contained in:
Marco Martin 2019-08-23 11:23:46 +02:00
parent 0d78a4e1d7
commit 30c06679ae
2 changed files with 7 additions and 10 deletions

View file

@ -64,7 +64,7 @@ ContainmentLayoutManager.ItemContainer {
onUserDrag: {
dragCenterX = dragCenter.x;
dragCenterY = dragCenter.y;
launcherDragManager.dragItem(delegate, index, dragCenter.x, dragCenter.y);
launcherDragManager.dragItem(delegate, dragCenter.x, dragCenter.y);
}
contentItem: MouseArea {

View file

@ -39,7 +39,7 @@ QtObject {
internal.showSpacer(item, 0, 0);
}
function dragItem(delegate, index, dragCenterX, dragCenterY) {
function dragItem(delegate, dragCenterX, dragCenterY) {
// newPosition
var newRow = 0;
@ -50,15 +50,15 @@ QtObject {
var pos = favoriteStrip.mapFromItem(delegate, 0, 0);
newRow = Math.floor((pos.x + dragCenterX) / delegate.width);
plasmoid.nativeInterface.applicationListModel.setLocation(index, ApplicationListModel.Favorites);
plasmoid.nativeInterface.applicationListModel.setLocation(delegate.modelData.index, ApplicationListModel.Favorites);
internal.showSpacer(delegate, dragCenterX, dragCenterY);
plasmoid.nativeInterface.applicationListModel.moveItem(modelData.index, newRow);
plasmoid.nativeInterface.applicationListModel.moveItem(delegate.modelData.index, newRow);
// Put it on desktop
} else if (newContainer == appletsLayout) {
var pos = appletsLayout.mapFromItem(delegate, 0, 0);
plasmoid.nativeInterface.applicationListModel.setLocation(index, ApplicationListModel.Desktop);
plasmoid.nativeInterface.applicationListModel.setLocation(delegate.modelData.index, ApplicationListModel.Desktop);
internal.showSpacer(delegate, dragCenterX, dragCenterY);
return;
@ -67,14 +67,11 @@ QtObject {
} else {
newRow = Math.round(newContainer.flow.width / delegate.width) * Math.floor((delegate.y + dragCenterY) / delegate.height) + Math.floor((delegate.x + dragCenterX) / delegate.width) + favoriteStrip.count;
plasmoid.nativeInterface.applicationListModel.setLocation(index, ApplicationListModel.Grid);
plasmoid.nativeInterface.applicationListModel.setLocation(delegate.modelData.index, ApplicationListModel.Grid);
internal.showSpacer(delegate, dragCenterX, dragCenterY);
plasmoid.nativeInterface.applicationListModel.moveItem(modelData.index, newRow);
plasmoid.nativeInterface.applicationListModel.moveItem(delegate.modelData.index, newRow);
}
internal.showSpacer(delegate, dragCenterX, dragCenterY);
plasmoid.nativeInterface.applicationListModel.moveItem(modelData.index, newRow);
}
function dropItem(item, dragCenterX, dragCenterY) {