Merge pull request #691 from resolritter/hover

Accept Backtab and Shift-Tab for hovering selection backwards
This commit is contained in:
DeepBlueV7.X 2021-08-22 16:08:10 +00:00 committed by GitHub
commit c0da89d491
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 14 deletions

View file

@ -80,15 +80,16 @@ Popup {
completerPopup.completer.searchString = text;
}
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;
completerPopup.up();
} else if (event.key == Qt.Key_Down && completerPopup.opened) {
event.accepted = true;
completerPopup.down();
} else if (event.key == Qt.Key_Tab && completerPopup.opened) {
} else if ((event.key == Qt.Key_Down || event.key == Qt.Key_Tab) && completerPopup.opened) {
event.accepted = true;
if (event.key == Qt.Key_Tab && (event.modifiers & Qt.ShiftModifier)) {
completerPopup.up();
} else {
completerPopup.down();
}
} else if (event.matches(StandardKey.InsertParagraphSeparator)) {
completerPopup.finishCompletion();
event.accepted = true;

View file

@ -195,7 +195,11 @@ Rectangle {
} else if (event.key == Qt.Key_Tab) {
event.accepted = true;
if (popup.opened) {
if (event.modifiers & Qt.ShiftModifier) {
popup.down();
} else {
popup.up();
}
} else {
var pos = cursorPosition - 1;
while (pos > -1) {
@ -219,7 +223,7 @@ Rectangle {
} else if (event.key == Qt.Key_Up && popup.opened) {
event.accepted = true;
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;
popup.down();
} else if (event.key == Qt.Key_Up && event.modifiers == Qt.NoModifier) {

View file

@ -39,15 +39,16 @@ Popup {
completerPopup.completer.searchString = text;
}
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;
completerPopup.up();
} else if (event.key == Qt.Key_Down && completerPopup.opened) {
event.accepted = true;
completerPopup.down();
} else if (event.key == Qt.Key_Tab && completerPopup.opened) {
} else if ((event.key == Qt.Key_Down || event.key == Qt.Key_Tab) && completerPopup.opened) {
event.accepted = true;
if (event.key == Qt.Key_Tab && (event.modifiers & Qt.ShiftModifier)) {
completerPopup.up();
} else {
completerPopup.down();
}
} else if (event.matches(StandardKey.InsertParagraphSeparator)) {
completerPopup.finishCompletion();
event.accepted = true;