mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-24 15:25:31 -04:00
add cyclic arrowkey navigation for entryview
This commit is contained in:
parent
e4088d5e6c
commit
745d255808
3 changed files with 18 additions and 15 deletions
|
@ -121,6 +121,20 @@ void EntryView::keyPressEvent(QKeyEvent* event)
|
|||
#endif
|
||||
}
|
||||
|
||||
int last = m_model->rowCount() - 1;
|
||||
|
||||
if (event->key() == Qt::Key_Up && currentIndex().row() == 0) {
|
||||
QModelIndex index = m_sortModel->mapToSource(m_sortModel->index(last, 0));
|
||||
setCurrentEntry(m_model->entryFromIndex(index));
|
||||
return;
|
||||
}
|
||||
|
||||
if (event->key() == Qt::Key_Down && currentIndex().row() == last) {
|
||||
QModelIndex index = m_sortModel->mapToSource(m_sortModel->index(0, 0));
|
||||
setCurrentEntry(m_model->entryFromIndex(index));
|
||||
return;
|
||||
}
|
||||
|
||||
QTreeView::keyPressEvent(event);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue