Tweak book: File list: Allow using ctrl+Left/Right to move an item to top/bottom of the list

This commit is contained in:
Kovid Goyal
2026-03-24 08:42:32 +05:30
parent a1bba6a788
commit bb286f660f
+4 -1
View File
@@ -844,7 +844,10 @@ class FileList(QTreeWidget, OpenWithHandler):
self.request_delete()
elif mods == (Qt.KeyboardModifier.ControlModifier | Qt.KeyboardModifier.ShiftModifier):
m = self.categories['text'].childCount()
amt = {Qt.Key.Key_Up: -1, Qt.Key.Key_Down: 1, Qt.Key.Key_Home: -m, Qt.Key.Key_End: m}.get(k, None)
amt = {
Qt.Key.Key_Up: -1, Qt.Key.Key_Down: 1, Qt.Key.Key_Home: -m, Qt.Key.Key_End: m,
Qt.Key.Key_Left: -m, Qt.Key.Key_Right: m
}.get(k)
if amt is not None:
ev.accept()
self.move_selected_text_items(amt)