diff options
Diffstat (limited to 'src/yuzu/applets/software_keyboard.cpp')
-rw-r--r-- | src/yuzu/applets/software_keyboard.cpp | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/src/yuzu/applets/software_keyboard.cpp b/src/yuzu/applets/software_keyboard.cpp index 653486493..a9a095d58 100644 --- a/src/yuzu/applets/software_keyboard.cpp +++ b/src/yuzu/applets/software_keyboard.cpp @@ -404,12 +404,16 @@ void QtSoftwareKeyboardDialog::ShowTextCheckDialog( OverlayDialog dialog(this, system, QString{}, QString::fromStdU16String(text_check_message), tr("Cancel"), tr("OK"), Qt::AlignCenter); - if (dialog.exec() == QDialog::Accepted) { - emit SubmitNormalText(SwkbdResult::Ok, current_text); + if (dialog.exec() != QDialog::Accepted) { + StartInputThread(); 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; } } @@ -480,11 +484,7 @@ void QtSoftwareKeyboardDialog::open() { void QtSoftwareKeyboardDialog::reject() { // Pressing the ESC key in a dialog calls QDialog::reject(). // We will override this behavior to the "Cancel" action on the software keyboard. - if (is_inline) { - emit SubmitInlineText(SwkbdReplyType::DecidedCancel, current_text, cursor_position); - } else { - emit SubmitNormalText(SwkbdResult::Cancel, current_text); - } + TranslateButtonPress(HIDButton::X); } void QtSoftwareKeyboardDialog::keyPressEvent(QKeyEvent* event) { @@ -720,21 +720,9 @@ void QtSoftwareKeyboardDialog::SetTextDrawType() { ui->line_edit_osk->setFocus(); }); - connect(ui->line_edit_osk, &QLineEdit::returnPressed, [this] { - switch (bottom_osk_index) { - case BottomOSKIndex::LowerCase: - ui->button_ok->click(); - break; - case BottomOSKIndex::UpperCase: - ui->button_ok_shift->click(); - break; - case BottomOSKIndex::NumberPad: - ui->button_ok_num->click(); - break; - default: - break; - } - }); + connect( + ui->line_edit_osk, &QLineEdit::returnPressed, this, + [this] { TranslateButtonPress(HIDButton::Plus); }, Qt::QueuedConnection); ui->line_edit_osk->setPlaceholderText( QString::fromStdU16String(initialize_parameters.guide_text)); |