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

View file

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