Make Kickoff restore favorites order when dragging an item to desktop
AcceptedPublic

Authored by lisin on Aug 9 2019, 10:02 AM.

Details

Reviewers
ngraham
hein
Group Reviewers
Plasma
Summary

This fixes the undesired reordering of the favorites which could happen when dragging an item to desktop by restoring the order of favorites when the cursor leaves Kickoff.

BUG: 385856
FIXED-IN: 5.17.0

Diff Detail

Repository
R119 Plasma Desktop
Lint
Lint Skipped
Unit
Unit Tests Skipped
lisin created this revision.Aug 9 2019, 10:02 AM
Restricted Application added a project: Plasma. · View Herald TranscriptAug 9 2019, 10:02 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
lisin requested review of this revision.Aug 9 2019, 10:02 AM
lisin added a comment.EditedAug 9 2019, 10:09 AM

I was reluctant to introduce a new variable with such a broad scope (kickoff.dragStartRow) but using the startRow from DropArea would sometimes still mess up the order - startRow would be set to whatever new current index every time the user moved the cursor back inside DropArea, so it would be snapping back to the wrong position. It's not really something a user would commonly do, so I can edit the code to use it instead. Otherwise, startRow wasn't used anywhere so I removed it completely.

lisin updated this revision to Diff 63398.Aug 9 2019, 10:17 AM

Added isChildOf(source, favoritesView) which is probably needed.

ngraham accepted this revision.Aug 9 2019, 12:58 PM

+1, nice. Plasma folks?

applets/kickoff/package/contents/ui/FavoritesView.qml
94

Could you add a comment explaining why this is done, for the benefit of people reading the code in the future?

This revision is now accepted and ready to land.Aug 9 2019, 12:58 PM
ngraham edited the summary of this revision. (Show Details)Aug 9 2019, 12:58 PM
lisin updated this revision to Diff 63407.Aug 9 2019, 1:37 PM

Sure, I've added the comment

hein accepted this revision.Dec 12 2019, 5:51 PM

Good one, thanks!