[app] Fixed the problem with the initial focus
If the first press isn't ignored by the drag area then the first flick won't work. The problem has something to do with this drag area as everything works fine if the drag area is removed. Couldn't figure out what exactly the problem was and what's wrong with the initial focus, but this hack makes things work.
This commit is contained in:
parent
26e651a932
commit
08c0904a84
1 changed files with 9 additions and 0 deletions
|
@ -55,6 +55,7 @@ MouseArea {
|
|||
property bool dragCloseToTheRightEdge
|
||||
property real dragLastX
|
||||
property real dragLastY
|
||||
property bool _ignorePress: true
|
||||
|
||||
onDraggedItemIndexChanged: {
|
||||
draggedItem = (draggedItemIndex >= 0) ? shelf.get(draggedItemIndex) : null
|
||||
|
@ -119,6 +120,14 @@ MouseArea {
|
|||
if (mouseY + gridView.contentY < 0) {
|
||||
// Let the header item handle it
|
||||
mouse.accepted = false
|
||||
} else if (_ignorePress) {
|
||||
// If the first press isn't ignored here then the first flick
|
||||
// won't work. The problem has something to do with this drag
|
||||
// area as everything works fine if the drag area is removed.
|
||||
// Couldn't figure out what exactly the problem was and what's
|
||||
// wrong with the initial focus, but this hack makes things work.
|
||||
_ignorePress = false
|
||||
mouse.accepted = false
|
||||
}
|
||||
}
|
||||
onReleased: {
|
||||
|
|
Loading…
Reference in a new issue