mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-10-30 17:40:47 +03:00
accept Backtab and Shift-Tab for hovering selection backwards
This commit is contained in:
parent
2cabd107bf
commit
b5af1d81df
3 changed files with 20 additions and 14 deletions
|
@ -80,15 +80,16 @@ Popup {
|
||||||
completerPopup.completer.searchString = text;
|
completerPopup.completer.searchString = text;
|
||||||
}
|
}
|
||||||
Keys.onPressed: {
|
Keys.onPressed: {
|
||||||
if (event.key == Qt.Key_Up && completerPopup.opened) {
|
if ((event.key == Qt.Key_Up || event.key == Qt.Key_Backtab) && completerPopup.opened) {
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
completerPopup.up();
|
completerPopup.up();
|
||||||
} else if (event.key == Qt.Key_Down && completerPopup.opened) {
|
} else if ((event.key == Qt.Key_Down || event.key == Qt.Key_Tab) && completerPopup.opened) {
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
completerPopup.down();
|
if (event.key == Qt.Key_Tab && (event.modifiers & Qt.ShiftModifier)) {
|
||||||
} else if (event.key == Qt.Key_Tab && completerPopup.opened) {
|
completerPopup.up();
|
||||||
event.accepted = true;
|
} else {
|
||||||
completerPopup.down();
|
completerPopup.down();
|
||||||
|
}
|
||||||
} else if (event.matches(StandardKey.InsertParagraphSeparator)) {
|
} else if (event.matches(StandardKey.InsertParagraphSeparator)) {
|
||||||
completerPopup.finishCompletion();
|
completerPopup.finishCompletion();
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
|
|
|
@ -195,7 +195,11 @@ Rectangle {
|
||||||
} else if (event.key == Qt.Key_Tab) {
|
} else if (event.key == Qt.Key_Tab) {
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
if (popup.opened) {
|
if (popup.opened) {
|
||||||
popup.up();
|
if (event.modifiers & Qt.ShiftModifier) {
|
||||||
|
popup.down();
|
||||||
|
} else {
|
||||||
|
popup.up();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
var pos = cursorPosition - 1;
|
var pos = cursorPosition - 1;
|
||||||
while (pos > -1) {
|
while (pos > -1) {
|
||||||
|
@ -219,7 +223,7 @@ Rectangle {
|
||||||
} else if (event.key == Qt.Key_Up && popup.opened) {
|
} else if (event.key == Qt.Key_Up && popup.opened) {
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
popup.up();
|
popup.up();
|
||||||
} else if (event.key == Qt.Key_Down && popup.opened) {
|
} else if ((event.key == Qt.Key_Down || event.key == Qt.Key_Backtab) && popup.opened) {
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
popup.down();
|
popup.down();
|
||||||
} else if (event.key == Qt.Key_Up && event.modifiers == Qt.NoModifier) {
|
} else if (event.key == Qt.Key_Up && event.modifiers == Qt.NoModifier) {
|
||||||
|
|
|
@ -39,15 +39,16 @@ Popup {
|
||||||
completerPopup.completer.searchString = text;
|
completerPopup.completer.searchString = text;
|
||||||
}
|
}
|
||||||
Keys.onPressed: {
|
Keys.onPressed: {
|
||||||
if (event.key == Qt.Key_Up && completerPopup.opened) {
|
if ((event.key == Qt.Key_Up || event.key == Qt.Key_Backtab) && completerPopup.opened) {
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
completerPopup.up();
|
completerPopup.up();
|
||||||
} else if (event.key == Qt.Key_Down && completerPopup.opened) {
|
} else if ((event.key == Qt.Key_Down || event.key == Qt.Key_Tab) && completerPopup.opened) {
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
completerPopup.down();
|
if (event.key == Qt.Key_Tab && (event.modifiers & Qt.ShiftModifier)) {
|
||||||
} else if (event.key == Qt.Key_Tab && completerPopup.opened) {
|
completerPopup.up();
|
||||||
event.accepted = true;
|
} else {
|
||||||
completerPopup.down();
|
completerPopup.down();
|
||||||
|
}
|
||||||
} else if (event.matches(StandardKey.InsertParagraphSeparator)) {
|
} else if (event.matches(StandardKey.InsertParagraphSeparator)) {
|
||||||
completerPopup.finishCompletion();
|
completerPopup.finishCompletion();
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
|
|
Loading…
Reference in a new issue