-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix drag and drop for stacked diagrams (follow-up) #60600
base: master
Are you sure you want to change the base?
Fix drag and drop for stacked diagrams (follow-up) #60600
Conversation
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
f5d8202
to
1940074
Compare
This comment was marked as outdated.
This comment was marked as outdated.
1940074
to
ec63a27
Compare
(Rebased) |
ec63a27
to
633c12a
Compare
Thanks for the review @nirvn, I've addressed the comments to keep the fixes while keeping copy&paste eventual addition still possible (which, by the way I'd be happy to add in another PR). |
633c12a
to
623e924
Compare
The last commit clears the current item from the view. As you can see in this screencast, the current item is a leftover, since it sticks to the dragged item's index, showing no valuable information to users. dragndrop_stackeddiagrams_active_items.mp4Additionally, this clearing brings some harmonization with other flat lists after a drag'n'drop, e.g., Graduated and Classification ones for vector layer symbology. |
623e924
to
306aef4
Compare
(Rebased to build on top of working CI) |
…s (items don't have children so far), because of that, we can drop at any index as well
…en dropped 'inside' an item; only enable drops on invalid items, which eases dropping handling
…ent because it sticks to last activated item's index (the one that was dragged, thus remaining as a leftover from the user perspective, who would be more interested in the dropped index being the current item)
306aef4
to
5faf094
Compare
Follow-up #60278.
This PR adjusts issues and improves consistency with drag and drop behavior in other parts of QGIS. See #60596 for screencasts of the buggy behavior in the current master.
Namely, this PR:
Replaces the drop indicator, switching from a box to a horizontal line (which expands to the whole row). The rationale is that stacked diagrams don't handle (yet) a parent-child hierarchy (i.e., one cannot have nested stacked diagrams in the GUI), but act instead as a flat list. This is consistent with drag and drop for other flat lists in QGIS (e.g., classification symbol lists or graduated symbol lists).
Fixes an issue that moves the dropped item to the end of the list (i.e., an append operation), even if the desired position was, e.g., between other items.
Fixes an issue that makes it possible to obtain copies of the dragged object.
Enables moving multiple items and positioning them in the expected way (e.g., if a diagram A is below a diagram B before the drag, it should continue being below B once dropped).
Minor fixes: Allow dropping items below all other items (i.e., in the blank area), as well as in the whole row span (i.e., also for columns > 0).
Clear leftover current index in the view after the drag'n'drop. This is how other flat lists behave, e.g., Graduated and Classification symbology for vector layers.
Screencast of the result:
dragndrop_stackeddiagrams.mp4
Fix #60596