dismiss applet edit mode by touch

This commit is contained in:
Marco Martin 2021-04-08 17:36:23 +02:00
parent bd55057933
commit a79a7f31f8
2 changed files with 11 additions and 2 deletions

View file

@ -148,9 +148,10 @@ DragDrop.DropArea {
//Hides icons close button
appletsLayout.appletsLayoutInteracted();
appletsLayout.editMode = false;
appletsLayout.forceActiveFocus();
}
onLongPressed: appletsLayout.editMode = true;
onPressedChanged: root.focus = true;
onPressedChanged: appletsLayout.focus = true;
}
cellWidth: favoriteStrip.cellWidth
@ -195,6 +196,8 @@ DragDrop.DropArea {
// Must be 0, 0 as at this point dragCenterX and dragCenterY are on the drag before"
launcherDragManager.startDrag(appletContainer);
launcherDragManager.currentlyDraggedDelegate = appletContainer;
// Reparenting removed focus
appletContainer.forceActiveFocus();
} else {
launcherDragManager.dropItem(appletContainer, dragCenterX, dragCenterY);
plasmoid.editMode = false;
@ -223,6 +226,12 @@ DragDrop.DropArea {
appletContainer.x = Math.max(0, Math.min(mainFlickable.width - appletContainer.width, appletContainer.x));
}
Connections {
target: appletsLayout
function onAppletsLayoutInteracted() {
appletContainer.editMode = false;
}
}
Connections {
target: dropArea
function onWidthChanged () {

View file

@ -74,7 +74,7 @@ DragHandler {
snapPrevPage();
} else if (__scrollDirection === DragGestureHandler.Right && (mainFlickable.contentX - __initialMainFlickableX > PlasmaCore.Units.gridUnit * 5)) {
snapNextPage();
} else {print("normal");
} else {
snapPage();
}
__scrollDirection = DragGestureHandler.None;