Browse Source

Prioritize dialog: fix drag-n-drop putting items before the last item

When the items in the prioritizations list were drag-n-dropped to the
empty space, the row was equal to -1 and the dropped items ended up
being moved to the position before the last item. Fixing the row value
helps to avoid that behavior.

Signed-off-by: Sergey Zhuravlevich <[email protected]>
tags/4.1.0^2
Sergey Zhuravlevich 1 month ago
parent
commit
b5a3313f80
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      qt/prioritize_dialog.py

+ 6
- 0
qt/prioritize_dialog.py View File

@@ -47,6 +47,12 @@ class PrioritizationList(ListviewModel):
# to know where the drop took place.
if parentIndex.isValid():
return False
# "When row and column are -1 it means that the dropped data should be considered as
# dropped directly on parent."
# Moving items to row -1 would put them before the last item. Fix the row to drop the
# dragged items after the last item.
if row < 0:
row = len(self.model) - 1
strMimeData = bytes(mimeData.data(MIME_INDEXES)).decode()
indexes = list(map(int, strMimeData.split(",")))
self.model.move_indexes(indexes, row)


Loading…
Cancel
Save