diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index 832cb0ef8f..84d5049d6c 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -102,7 +102,7 @@ bool Launcher::GraphicsPage::loadSettings() const int width = Settings::video().mResolutionX; const int height = Settings::video().mResolutionY; - QString resolution = QString::number(width) + QString(" x ") + QString::number(height); + QString resolution = QString::number(width) + QString(" × ") + QString::number(height); screenComboBox->setCurrentIndex(Settings::video().mScreen); int resIndex = resolutionComboBox->findText(resolution, Qt::MatchStartsWith); @@ -189,7 +189,7 @@ void Launcher::GraphicsPage::saveSettings() int cHeight = 0; if (standardRadioButton->isChecked()) { - QRegularExpression resolutionRe("^(\\d+) x (\\d+)"); + QRegularExpression resolutionRe("^(\\d+) × (\\d+)"); QRegularExpressionMatch match = resolutionRe.match(resolutionComboBox->currentText().simplified()); if (match.hasMatch()) { @@ -289,7 +289,7 @@ QStringList Launcher::GraphicsPage::getAvailableResolutions(int screen) return result; } - auto str = Misc::getResolutionText(mode.w, mode.h); + auto str = Misc::getResolutionText(mode.w, mode.h, "%i × %i (%i:%i)"); result.append(QString(str.c_str())); } diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp index 2d9a9d8292..1060b3a20f 100644 --- a/apps/openmw/mwgui/settingswindow.cpp +++ b/apps/openmw/mwgui/settingswindow.cpp @@ -352,7 +352,7 @@ namespace MWGui std::sort(resolutions.begin(), resolutions.end(), sortResolutions); for (std::pair& resolution : resolutions) { - std::string str = Misc::getResolutionText(resolution.first, resolution.second); + std::string str = Misc::getResolutionText(resolution.first, resolution.second, "%i x %i (%i:%i)"); if (mResolutionList->findItemIndexWith(str) == MyGUI::ITEM_NONE) mResolutionList->addItem(str); diff --git a/components/misc/display.cpp b/components/misc/display.cpp index 7570914483..ee78b2a0c9 100644 --- a/components/misc/display.cpp +++ b/components/misc/display.cpp @@ -7,7 +7,7 @@ namespace Misc { - std::string getResolutionText(int x, int y) + std::string getResolutionText(int x, int y, const std::string& format) { int gcd = std::gcd(x, y); if (gcd == 0) @@ -77,6 +77,6 @@ namespace Misc if (flipped) std::swap(xaspect, yaspect); - return Misc::StringUtils::format("%i x %i (%i:%i)", x, y, xaspect, yaspect); + return Misc::StringUtils::format(format, x, y, xaspect, yaspect); } } diff --git a/components/misc/display.hpp b/components/misc/display.hpp index 6f60a48cda..82037661c8 100644 --- a/components/misc/display.hpp +++ b/components/misc/display.hpp @@ -5,7 +5,7 @@ namespace Misc { - std::string getResolutionText(int x, int y); + std::string getResolutionText(int x, int y, const std::string& format); } #endif