mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-29 01:06:27 -05:00
add cyclic arrowkey navigation for entryview
This commit is contained in:
parent
e4088d5e6c
commit
745d255808
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
AutoTypeSelectView::AutoTypeSelectView(QWidget* parent)
|
AutoTypeSelectView::AutoTypeSelectView(QWidget* parent)
|
||||||
: EntryView(parent)
|
: EntryView(parent)
|
||||||
@ -59,14 +58,8 @@ void AutoTypeSelectView::selectFirstEntry()
|
|||||||
|
|
||||||
void AutoTypeSelectView::keyReleaseEvent(QKeyEvent* e)
|
void AutoTypeSelectView::keyReleaseEvent(QKeyEvent* e)
|
||||||
{
|
{
|
||||||
qDebug() << e->key();
|
if (e->key() == Qt::Key_Escape) {
|
||||||
|
emit rejected();
|
||||||
if (!e->modifiers() || (e->modifiers() & Qt::KeypadModifier && e->key() == Qt::Key_Enter)) {
|
|
||||||
if (e->key() == Qt::Key_Escape) {
|
|
||||||
emit rejected();
|
|
||||||
} else {
|
|
||||||
e->ignore();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
e->ignore();
|
e->ignore();
|
||||||
}
|
}
|
||||||
|
@ -153,12 +153,8 @@ void PasswordGeneratorWidget::setStandaloneMode(bool standalone)
|
|||||||
|
|
||||||
void PasswordGeneratorWidget::keyPressEvent(QKeyEvent* e)
|
void PasswordGeneratorWidget::keyPressEvent(QKeyEvent* e)
|
||||||
{
|
{
|
||||||
if (!e->modifiers() || (e->modifiers() & Qt::KeypadModifier && e->key() == Qt::Key_Enter)) {
|
if (e->key() == Qt::Key_Escape && m_standalone == true) {
|
||||||
if (e->key() == Qt::Key_Escape && m_standalone == true) {
|
emit dialogTerminated();
|
||||||
emit dialogTerminated();
|
|
||||||
} else {
|
|
||||||
e->ignore();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
e->ignore();
|
e->ignore();
|
||||||
}
|
}
|
||||||
|
@ -121,6 +121,20 @@ void EntryView::keyPressEvent(QKeyEvent* event)
|
|||||||
#endif
|
#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);
|
QTreeView::keyPressEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user