Commit b1952160 authored by con's avatar con
Browse files

Tab and back tab in locator where moving the focus to some weird place.

Let it cycle through elements instead.

Requested-by: aep
parent 6b37fe19
......@@ -111,6 +111,26 @@ public:
}
#endif
void next() {
int index = currentIndex().row();
++index;
if (index >= model()->rowCount(QModelIndex())) {
// wrap
index = 0;
}
setCurrentIndex(model()->index(index, 0));
}
void previous() {
int index = currentIndex().row();
--index;
if (index < 0) {
// wrap
index = model()->rowCount(QModelIndex()) - 1;
}
setCurrentIndex(model()->index(index, 0));
}
private:
QSize m_preferredSize;
};
......@@ -386,6 +406,12 @@ bool LocatorWidget::eventFilter(QObject *obj, QEvent *event)
case Qt::Key_Escape:
m_completionList->hide();
return true;
case Qt::Key_Tab:
m_completionList->next();
return true;
case Qt::Key_Backtab:
m_completionList->previous();
return true;
default:
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment