Add clipboard history Home End navigation

This commit is contained in:
David Heinemeier Hansson
2026-06-29 12:58:04 -05:00
parent 472b5cd557
commit b9f2d41e86
2 changed files with 26 additions and 0 deletions
+14
View File
@@ -169,6 +169,14 @@ Item {
resultList.positionViewAtIndex(selectedIndex, ListView.Contain)
}
function selectAbsolute(index) {
if (displayModel.count === 0) return
root.disarmPointer()
root.cursorActive = true
root.selectedIndex = Math.max(0, Math.min(index, displayModel.count - 1))
resultList.positionViewAtIndex(root.selectedIndex, ListView.Contain)
}
function setFilter(nextFilter) {
root.filterText = nextFilter
root.selectedIndex = 0
@@ -345,6 +353,12 @@ Item {
} else if (event.key === Qt.Key_PageDown) {
root.select(6)
event.accepted = true
} else if (event.key === Qt.Key_Home) {
root.selectAbsolute(0)
event.accepted = true
} else if (event.key === Qt.Key_End) {
root.selectAbsolute(displayModel.count - 1)
event.accepted = true
} else if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
if (root.cursorActive && (event.modifiers & Qt.AltModifier)) root.openIndex(root.selectedIndex)
else if (root.cursorActive && (event.modifiers & Qt.ShiftModifier)) root.copyIndex(root.selectedIndex)