mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-07 18:43:26 -08:00
Revert "[UI] Auto-select first completion match in popup"
This reverts commit ae0dfb8622.
This commit is contained in:
parent
155f3792a4
commit
c020f7c1b3
2 changed files with 4 additions and 3 deletions
|
|
@ -176,11 +176,11 @@ void CardCompleterStyler::ensureClosestSelected()
|
||||||
}
|
}
|
||||||
|
|
||||||
const int currentRow = popup->currentIndex().row();
|
const int currentRow = popup->currentIndex().row();
|
||||||
const int closestRow = 0;
|
const int closestRow = rowCount - 1;
|
||||||
|
|
||||||
if (currentRow != closestRow) {
|
if (currentRow != closestRow) {
|
||||||
popup->selectionModel()->setCurrentIndex(completionModel->index(closestRow, completer->completionColumn()),
|
popup->selectionModel()->setCurrentIndex(completionModel->index(closestRow, completer->completionColumn()),
|
||||||
QItemSelectionModel::SelectCurrent);
|
QItemSelectionModel::NoUpdate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,8 @@ void LineEditCompleter::focusOutEvent(QFocusEvent *e)
|
||||||
|
|
||||||
if (popupWasVisible && e->reason() == Qt::TabFocusReason) {
|
if (popupWasVisible && e->reason() == Qt::TabFocusReason) {
|
||||||
// Refocus the edit so Tab doesn't move focus away
|
// Refocus the edit so Tab doesn't move focus away
|
||||||
setFocus();
|
// Use a queued connection to ensure focus is restored after the focus change completes
|
||||||
|
QMetaObject::invokeMethod(this, "setFocus", Qt::QueuedConnection);
|
||||||
e->accept();
|
e->accept();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue