z-order weirdness when dragging ListItems

Bug #1498138 reported by Robert Schroll
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-ui-toolkit (Ubuntu)
Confirmed
Medium
Zsombor Egri

Bug Description

ListItems in a ListView start off with a z of 1. When you start dragging them, they get a z of 2. This causes two bits of weirdness:

1) Section headers in the ListView also have a z of 2. (See http://doc.qt.io/qt-5/qml-qtquick-listview.html#section-prop) This causes inconsistent layering of the dragged item relative to headers. Sometimes it appears above the headers, sometimes below. I haven't found a rhyme or reason to which occurs when, but I can eliminate the problem by reducing the z index of the headers. A better solution, in my mind, would be to increase the z index of items while they are being dragged.

2) The z index of items is not reset when the drag ends. I haven't noticed any problems caused by this in my testing, but this is the sort of unexpected behavior that is almost guaranteed to cause confusion down the line.

This is seen the the current stable image (r1 on flo).

Tags: listitem
Revision history for this message
Zsombor Egri (zsombi) wrote :

1) Indeed, we should set the z-order to be MAXINT while dragged so they go over any element in the view.
2) you don't see the z-order going back to 1 as the dragged item is duplicated, the original one is hidden for the entire time of dragging and the duplicate is set to be z-ordered 2. This duplicate is then deleted when dropped event animations are completed.

So the only bug we have is the z-order of the dragged element.

Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Zsombor Egri (zsombi)
Zsombor Egri (zsombi)
tags: added: listitem
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.