aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/applets/software_keyboard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/yuzu/applets/software_keyboard.cpp')
-rw-r--r--src/yuzu/applets/software_keyboard.cpp34
1 files changed, 14 insertions, 20 deletions
diff --git a/src/yuzu/applets/software_keyboard.cpp b/src/yuzu/applets/software_keyboard.cpp
index fd3368479d..b0f764994b 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) {
@@ -1027,10 +1027,8 @@ void QtSoftwareKeyboardDialog::ChangeBottomOSKIndex() {
ui->bottomOSK->setCurrentIndex(static_cast<int>(bottom_osk_index));
ui->button_shift_shift->setStyleSheet(
- QStringLiteral("background-image: url(:/overlay/osk_button_shift_lock_off.png);"
- "\nbackground-position: left top;"
- "\nbackground-repeat: no-repeat;"
- "\nbackground-origin: content;"));
+ QStringLiteral("image: url(:/overlay/osk_button_shift_lock_off.png);"
+ "\nimage-position: left;"));
ui->button_shift_shift->setIconSize(ui->button_shift->iconSize());
ui->button_backspace_shift->setIconSize(ui->button_backspace->iconSize());
@@ -1040,10 +1038,8 @@ void QtSoftwareKeyboardDialog::ChangeBottomOSKIndex() {
caps_lock_enabled = false;
ui->button_shift_shift->setStyleSheet(
- QStringLiteral("background-image: url(:/overlay/osk_button_shift_lock_off.png);"
- "\nbackground-position: left top;"
- "\nbackground-repeat: no-repeat;"
- "\nbackground-origin: content;"));
+ QStringLiteral("image: url(:/overlay/osk_button_shift_lock_off.png);"
+ "\nimage-position: left;"));
ui->button_shift_shift->setIconSize(ui->button_shift->iconSize());
ui->button_backspace_shift->setIconSize(ui->button_backspace->iconSize());
@@ -1056,10 +1052,8 @@ void QtSoftwareKeyboardDialog::ChangeBottomOSKIndex() {
caps_lock_enabled = true;
ui->button_shift_shift->setStyleSheet(
- QStringLiteral("background-image: url(:/overlay/osk_button_shift_lock_on.png);"
- "\nbackground-position: left top;"
- "\nbackground-repeat: no-repeat;"
- "\nbackground-origin: content;"));
+ QStringLiteral("image: url(:/overlay/osk_button_shift_lock_on.png);"
+ "\nimage-position: left;"));
ui->button_shift_shift->setIconSize(ui->button_shift->iconSize());
ui->button_backspace_shift->setIconSize(ui->button_backspace->iconSize());