2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

applets/swkbd: Send the correct text string on TextCheck::Confirm

Previously the text string for the inline software keyboard was being sent instead of the normal software keyboard, leading to empty text being sent all the time.
This commit is contained in:
Morph 2021-05-18 08:20:05 -04:00
parent 7d86a6ff02
commit 5396593b55

View file

@ -404,12 +404,16 @@ void QtSoftwareKeyboardDialog::ShowTextCheckDialog(
OverlayDialog dialog(this, system, QString{}, QString::fromStdU16String(text_check_message), OverlayDialog dialog(this, system, QString{}, QString::fromStdU16String(text_check_message),
tr("Cancel"), tr("OK"), Qt::AlignCenter); tr("Cancel"), tr("OK"), Qt::AlignCenter);
if (dialog.exec() == QDialog::Accepted) { if (dialog.exec() != QDialog::Accepted) {
emit SubmitNormalText(SwkbdResult::Ok, current_text); StartInputThread();
break; break;
} }
StartInputThread(); auto text = ui->topOSK->currentIndex() == 1
? ui->text_edit_osk->toPlainText().toStdU16String()
: ui->line_edit_osk->text().toStdU16String();
emit SubmitNormalText(SwkbdResult::Ok, std::move(text));
break; break;
} }
} }
@ -480,11 +484,7 @@ void QtSoftwareKeyboardDialog::open() {
void QtSoftwareKeyboardDialog::reject() { void QtSoftwareKeyboardDialog::reject() {
// Pressing the ESC key in a dialog calls QDialog::reject(). // Pressing the ESC key in a dialog calls QDialog::reject().
// We will override this behavior to the "Cancel" action on the software keyboard. // We will override this behavior to the "Cancel" action on the software keyboard.
if (is_inline) { TranslateButtonPress(HIDButton::X);
emit SubmitInlineText(SwkbdReplyType::DecidedCancel, current_text, cursor_position);
} else {
emit SubmitNormalText(SwkbdResult::Cancel, current_text);
}
} }
void QtSoftwareKeyboardDialog::keyPressEvent(QKeyEvent* event) { void QtSoftwareKeyboardDialog::keyPressEvent(QKeyEvent* event) {