diff --git a/es-core/src/components/ButtonComponent.cpp b/es-core/src/components/ButtonComponent.cpp index 1fc36ff29..f794c7a66 100644 --- a/es-core/src/components/ButtonComponent.cpp +++ b/es-core/src/components/ButtonComponent.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT // -// ES-DE +// ES-DE Frontend // ButtonComponent.cpp // // Basic on/off button. diff --git a/es-core/src/components/ButtonComponent.h b/es-core/src/components/ButtonComponent.h index af17cc3fc..f083d60ea 100644 --- a/es-core/src/components/ButtonComponent.h +++ b/es-core/src/components/ButtonComponent.h @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT // -// ES-DE +// ES-DE Frontend // ButtonComponent.h // // Basic on/off button. @@ -20,7 +20,7 @@ public: ButtonComponent(const std::string& text = "", const std::string& helpText = "", const std::function& func = nullptr, - bool upperCase = true, + bool upperCase = false, bool flatStyle = false); void onSizeChanged() override; diff --git a/es-core/src/components/MenuComponent.cpp b/es-core/src/components/MenuComponent.cpp index 8b40de4ae..055b3f291 100644 --- a/es-core/src/components/MenuComponent.cpp +++ b/es-core/src/components/MenuComponent.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT // -// ES-DE +// ES-DE Frontend // MenuComponent.cpp // // Basic component for building a menu. @@ -10,6 +10,7 @@ #include "Settings.h" #include "components/ButtonComponent.h" +#include "utils/LocalizationUtil.h" #define BUTTON_GRID_VERT_PADDING Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 0.915f #define BUTTON_GRID_HORIZ_PADDING Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 0.283f @@ -83,7 +84,7 @@ void MenuComponent::save() void MenuComponent::setTitle(std::string title, const std::shared_ptr& font) { - mTitle->setText(Utils::String::toUpper(title)); + mTitle->setText(title); mTitle->setFont(font); } @@ -113,9 +114,12 @@ void MenuComponent::updateSize() } } - float width {std::min(mRenderer->getScreenHeight() * 1.05f, - mRenderer->getScreenWidth() * - (mRenderer->getIsVerticalOrientation() ? 0.94f : 0.90f))}; + float width {std::min( + mRenderer->getScreenHeight() * 1.05f * Utils::Localization::sMenuScaleFactor, + mRenderer->getScreenWidth() * (mRenderer->getIsVerticalOrientation() ? + 0.94f * Utils::Localization::sMenuScaleFactor : + 0.90f * Utils::Localization::sMenuScaleFactor))}; + setSize(width, height); } @@ -146,8 +150,7 @@ void MenuComponent::addButton(const std::string& name, const std::string& helpText, const std::function& callback) { - mButtons.push_back( - std::make_shared(Utils::String::toUpper(name), helpText, callback)); + mButtons.push_back(std::make_shared(name, helpText, callback)); updateGrid(); updateSize(); } diff --git a/es-core/src/components/MenuComponent.h b/es-core/src/components/MenuComponent.h index cb6100e5f..318c65894 100644 --- a/es-core/src/components/MenuComponent.h +++ b/es-core/src/components/MenuComponent.h @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT // -// ES-DE +// ES-DE Frontend // MenuComponent.h // // Basic component for building a menu. @@ -45,10 +45,9 @@ public: bool invert_when_selected = true) { ComponentListRow row; - row.addElement(std::make_shared(Utils::String::toUpper(label), - Font::get(FONT_SIZE_MEDIUM), - mMenuColorPrimary), - true); + row.addElement( + std::make_shared(label, Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary), + true); row.addElement(comp, false, invert_when_selected); addRow(row, setCursorHere); } diff --git a/es-core/src/components/OptionListComponent.h b/es-core/src/components/OptionListComponent.h index 14106ac6f..e2d53b5d1 100644 --- a/es-core/src/components/OptionListComponent.h +++ b/es-core/src/components/OptionListComponent.h @@ -342,16 +342,14 @@ private: for (auto it = mEntries.cbegin(); it != mEntries.cend(); ++it) { if (it->selected) { if (it->maxNameLength > 0.0f && - Font::get(FONT_SIZE_MEDIUM)->sizeText(Utils::String::toUpper(it->name)).x > - it->maxNameLength) { + Font::get(FONT_SIZE_MEDIUM)->sizeText(it->name).x > it->maxNameLength) { // A maximum length parameter has been passed and the "name" size surpasses // this value, so abbreviate the string inside the arrows. auto font = Font::get(FONT_SIZE_MEDIUM); - mText.setText(Utils::String::toUpper( - font->wrapText(Utils::String::toUpper(it->name), it->maxNameLength))); + mText.setText(font->wrapText(it->name, it->maxNameLength)); } else { - mText.setText(Utils::String::toUpper(it->name)); + mText.setText(it->name); } mText.setSize(0.0f, mText.getSize().y); @@ -433,8 +431,8 @@ private: for (auto it = mParent->mEntries.begin(); it != mParent->mEntries.end(); ++it) { row.elements.clear(); - auto textComponent = std::make_shared( - Utils::String::toUpper(it->name), font, mMenuColorPrimary); + auto textComponent = + std::make_shared(it->name, font, mMenuColorPrimary); row.addElement(textComponent, true); if (mParent->mMultiExclusiveSelect && hasSelectedRow && !(*it).selected) {