Commit cfb520e3 authored by Nate Graham's avatar Nate Graham
Browse files

Revert "Use onEntered in KickoffItemDelegate"

This reverts commit 8042ae81.

This change slightly improved performance, but subtle implementation
differences between the onEntered: and onPositionChanged: handlers in
MouseArea triggered two subtle and annoying bugs that users have
reported a bunch of duplicates of.

A way to fix the bugs using onEntered has not been found, so let's revert
the change for now; slightly worse performance is a less severe issue then
these bugs are.

BUG: 454349
BUG: 455674
FIXED-IN: 5.25.5
parent 4d132482
Pipeline #212157 passed with stage
in 3 minutes and 11 seconds
......@@ -204,15 +204,12 @@ T.ItemDelegate {
// Using this Item fixes drag and drop causing delegates
// to reset to a 0 X position and overlapping each other.
Item { id: dragItem }
// Using onPositionChanged adds subtle freeze when
// changing category. To address scrolling problem
// we'll rely on check if view was scrolled with wheel.
onEntered: {
if(root.view.movedWithWheel) {
root.view.movedWithWheel = false
return
}
// Using onPositionChanged instead of onEntered because it enables several
// desirable behaviors:
// 1. prevents changing selection while scrolling with the mouse wheel
// 2. Prevents the cursor position resetting selection when navigating using the keyboard
// See Bugs 455674 and 454349
onPositionChanged: {
// forceActiveFocus() touches multiple items, so check for
// activeFocus first to be more efficient.
if (!root.activeFocus) {
......
......@@ -78,7 +78,6 @@ EmptyPage {
readonly property real availableWidth: width - leftMargin - rightMargin
readonly property real availableHeight: height - topMargin - bottomMargin
property bool movedWithKeyboard: false
property bool movedWithWheel: false
Accessible.role: Accessible.List
......@@ -200,10 +199,6 @@ EmptyPage {
// because Plasma doesn't support Qt scaling.
horizontalStepSize: 20 * Qt.styleHints.wheelScrollLines * PlasmaCore.Units.devicePixelRatio
verticalStepSize: 20 * Qt.styleHints.wheelScrollLines * PlasmaCore.Units.devicePixelRatio
onWheel: {
view.movedWithWheel = true
}
}
Connections {
......@@ -222,12 +217,6 @@ EmptyPage {
onTriggered: view.movedWithKeyboard = false
}
Timer {
id: movedWithWheelTimer
interval: 200
onTriggered: view.movedWithWheel = false
}
function focusCurrentItem(event, focusReason) {
currentItem.forceActiveFocus(focusReason)
event.accepted = true
......
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