summaryrefslogtreecommitdiff
path: root/src/yuzu/applets
diff options
context:
space:
mode:
Diffstat (limited to 'src/yuzu/applets')
-rw-r--r--src/yuzu/applets/profile_select.cpp9
-rw-r--r--src/yuzu/applets/software_keyboard.cpp34
-rw-r--r--src/yuzu/applets/web_browser.cpp24
3 files changed, 30 insertions, 37 deletions
diff --git a/src/yuzu/applets/profile_select.cpp b/src/yuzu/applets/profile_select.cpp
index 0a4c48b3d..62fd1141c 100644
--- a/src/yuzu/applets/profile_select.cpp
+++ b/src/yuzu/applets/profile_select.cpp
@@ -10,7 +10,7 @@
#include <QScrollArea>
#include <QStandardItemModel>
#include <QVBoxLayout>
-#include "common/file_util.h"
+#include "common/fs/path_util.h"
#include "common/string_util.h"
#include "core/constants.h"
#include "core/hle/lock.h"
@@ -26,9 +26,10 @@ QString FormatUserEntryText(const QString& username, Common::UUID uuid) {
}
QString GetImagePath(Common::UUID uuid) {
- const auto path = Common::FS::GetUserPath(Common::FS::UserPath::NANDDir) +
- "/system/save/8000000000000010/su/avators/" + uuid.FormatSwitch() + ".jpg";
- return QString::fromStdString(path);
+ const auto path =
+ Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) /
+ fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormatSwitch());
+ return QString::fromStdString(Common::FS::PathToUTF8String(path));
}
QPixmap GetIcon(Common::UUID uuid) {
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));
diff --git a/src/yuzu/applets/web_browser.cpp b/src/yuzu/applets/web_browser.cpp
index 93e3a4f6f..34d3feb55 100644
--- a/src/yuzu/applets/web_browser.cpp
+++ b/src/yuzu/applets/web_browser.cpp
@@ -12,7 +12,7 @@
#include <QWebEngineUrlScheme>
#endif
-#include "common/file_util.h"
+#include "common/fs/path_util.h"
#include "core/core.h"
#include "core/frontend/input_interpreter.h"
#include "input_common/keyboard.h"
@@ -322,21 +322,25 @@ void QtNXWebEngineView::LoadExtractedFonts() {
QWebEngineScript nx_font_css;
QWebEngineScript load_nx_font;
- const QString fonts_dir = QString::fromStdString(Common::FS::SanitizePath(
- fmt::format("{}/fonts", Common::FS::GetUserPath(Common::FS::UserPath::CacheDir))));
+ auto fonts_dir_str = Common::FS::PathToUTF8String(
+ Common::FS::GetYuzuPath(Common::FS::YuzuPath::CacheDir) / "fonts/");
+
+ std::replace(fonts_dir_str.begin(), fonts_dir_str.end(), '\\', '/');
+
+ const auto fonts_dir = QString::fromStdString(fonts_dir_str);
nx_font_css.setName(QStringLiteral("nx_font_css.js"));
load_nx_font.setName(QStringLiteral("load_nx_font.js"));
nx_font_css.setSourceCode(
QString::fromStdString(NX_FONT_CSS)
- .arg(fonts_dir + QStringLiteral("/FontStandard.ttf"))
- .arg(fonts_dir + QStringLiteral("/FontChineseSimplified.ttf"))
- .arg(fonts_dir + QStringLiteral("/FontExtendedChineseSimplified.ttf"))
- .arg(fonts_dir + QStringLiteral("/FontChineseTraditional.ttf"))
- .arg(fonts_dir + QStringLiteral("/FontKorean.ttf"))
- .arg(fonts_dir + QStringLiteral("/FontNintendoExtended.ttf"))
- .arg(fonts_dir + QStringLiteral("/FontNintendoExtended2.ttf")));
+ .arg(fonts_dir + QStringLiteral("FontStandard.ttf"))
+ .arg(fonts_dir + QStringLiteral("FontChineseSimplified.ttf"))
+ .arg(fonts_dir + QStringLiteral("FontExtendedChineseSimplified.ttf"))
+ .arg(fonts_dir + QStringLiteral("FontChineseTraditional.ttf"))
+ .arg(fonts_dir + QStringLiteral("FontKorean.ttf"))
+ .arg(fonts_dir + QStringLiteral("FontNintendoExtended.ttf"))
+ .arg(fonts_dir + QStringLiteral("FontNintendoExtended2.ttf")));
load_nx_font.setSourceCode(QString::fromStdString(LOAD_NX_FONT));
nx_font_css.setInjectionPoint(QWebEngineScript::DocumentReady);