[ExpandableListItem] make it touch-friendly
ClosedPublic

Authored by ngraham on Apr 13 2020, 9:23 PM.

Details

Summary

Right now ExpandableListItem is not very touch-friendly due to use of a mousearea
hover effect for choosing the selected item. This patch fixes that by using a TapHandler
to handle left-clicks and touch input. We still need a MouseArea inside it to handle
non-touch hover and right-click behaviors.

FEATURE: 393749
FIXED-IN: 5.70

Test Plan

Click behavior is identical to how it was before, but now touch works too:

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ngraham created this revision.Apr 13 2020, 9:23 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 13 2020, 9:23 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
ngraham requested review of this revision.Apr 13 2020, 9:23 PM
ngraham planned changes to this revision.Apr 15 2020, 3:59 PM
ngraham updated this revision to Diff 80217.Apr 15 2020, 4:14 PM

Use TapHandler instead of MultiPointTouchArea

ngraham edited the summary of this revision. (Show Details)Apr 15 2020, 4:18 PM
ngraham updated this revision to Diff 80218.Apr 15 2020, 4:26 PM

Simpler enabled handling

This generically works, except for: would it be possible to make it so that clicking on an empty point will drop the list and button hover status? otherwise, you kind of get stuck to this situation:

(ps yay, first time I actually manage to try a patch and review it. I'm getting better!)

Good question. I'm not sure it's possible here; the list views that use this component as a delegate might have to learn how to unset the selection with their own TapHandler. I'm not 100% sure on that though.

This revision was not accepted when it landed; it landed in state Needs Review.Apr 18 2020, 5:45 AM
This revision was automatically updated to reflect the committed changes.