1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Fix handling Enter key in keypad in shortcuts

Closes #1792
This commit is contained in:
David Rosca 2016-01-02 19:58:54 +01:00
parent 53bf6662dc
commit 3e0583377d
4 changed files with 6 additions and 6 deletions

View File

@ -268,13 +268,13 @@ void BookmarksTreeView::keyPressEvent(QKeyEvent* event)
switch (event->key()) {
case Qt::Key_Return:
case Qt::Key_Enter:
if (item->isFolder() && event->modifiers() == Qt::NoModifier) {
if (item->isFolder() && (event->modifiers() == Qt::NoModifier || event->modifiers() == Qt::KeypadModifier)) {
setExpanded(index, !isExpanded(index));
}
else {
Qt::KeyboardModifiers modifiers = event->modifiers();
if (modifiers == Qt::NoModifier) {
if (modifiers == Qt::NoModifier || modifiers == Qt::KeypadModifier) {
emit bookmarkActivated(item);
}
else if (modifiers == Qt::ControlModifier) {

View File

@ -227,13 +227,13 @@ void HistoryTreeView::keyPressEvent(QKeyEvent* event)
switch (event->key()) {
case Qt::Key_Return:
case Qt::Key_Enter:
if (isTopLevel && event->modifiers() == Qt::NoModifier) {
if (isTopLevel && (event->modifiers() == Qt::NoModifier || event->modifiers() == Qt::KeypadModifier)) {
setExpanded(index, !isExpanded(index));
}
else {
Qt::KeyboardModifiers modifiers = event->modifiers();
if (modifiers == Qt::NoModifier) {
if (modifiers == Qt::NoModifier || modifiers == Qt::KeypadModifier) {
emit urlActivated(url);
}
else if (modifiers == Qt::ControlModifier) {

View File

@ -71,7 +71,7 @@ bool LocationCompleterView::eventFilter(QObject* object, QEvent* event)
break;
}
if (modifiers == Qt::NoModifier) {
if (modifiers == Qt::NoModifier || modifiers == Qt::KeypadModifier) {
emit indexActivated(idx);
return true;
}

View File

@ -99,7 +99,7 @@ void Menu::keyPressEvent(QKeyEvent* e)
return;
}
if (e->modifiers() == Qt::NoModifier) {
if (e->modifiers() == Qt::NoModifier || e->modifiers() == Qt::KeypadModifier) {
closeAllMenus();
act->trigger();
e->accept();