diff --git a/es-core/src/components/MenuComponent.cpp b/es-core/src/components/MenuComponent.cpp index 055b3f291..864f8feab 100644 --- a/es-core/src/components/MenuComponent.cpp +++ b/es-core/src/components/MenuComponent.cpp @@ -10,7 +10,6 @@ #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 @@ -114,11 +113,9 @@ void MenuComponent::updateSize() } } - 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))}; + float width {std::min(mRenderer->getScreenHeight() * 1.05f, + mRenderer->getScreenWidth() * + (mRenderer->getIsVerticalOrientation() ? 0.94f : 0.90f))}; setSize(width, height); } diff --git a/es-core/src/components/MenuComponent.h b/es-core/src/components/MenuComponent.h index 318c65894..65003e711 100644 --- a/es-core/src/components/MenuComponent.h +++ b/es-core/src/components/MenuComponent.h @@ -16,6 +16,7 @@ #include "components/NinePatchComponent.h" #include "components/ScrollIndicatorComponent.h" #include "components/TextComponent.h" +#include "utils/LocalizationUtil.h" #include "utils/StringUtil.h" #include @@ -24,7 +25,8 @@ class MenuComponent : public GuiComponent { public: MenuComponent(std::string title, - const std::shared_ptr& titleFont = Font::get(FONT_SIZE_LARGE)); + const std::shared_ptr& titleFont = + Font::get(FONT_SIZE_LARGE * Utils::Localization::sMenuTitleScaleFactor)); virtual ~MenuComponent(); void save(); diff --git a/es-core/src/utils/LocalizationUtil.cpp b/es-core/src/utils/LocalizationUtil.cpp index 9dafff194..6781335f2 100644 --- a/es-core/src/utils/LocalizationUtil.cpp +++ b/es-core/src/utils/LocalizationUtil.cpp @@ -29,7 +29,7 @@ namespace Utils { const std::vector> sSupportedLocales {{{"en"}, {"US"}}, {{"sv"}, {"SE"}}}; - float sMenuScaleFactor {1.0f}; + float sMenuTitleScaleFactor {1.0f}; std::pair getLocale() { @@ -90,7 +90,7 @@ namespace Utils } } - sMenuScaleFactor = 1.0f; + sMenuTitleScaleFactor = 1.0f; std::string languageSetting {Settings::getInstance()->getString("ApplicationLanguage")}; std::vector localeVector; std::pair localePair; @@ -138,9 +138,9 @@ namespace Utils locale = "en_US"; } - // Language-specific menu scale factor. + // Language-specific menu title scale factor. if (localePair.first == "sv") - sMenuScaleFactor = 1.02f; + sMenuTitleScaleFactor = 0.86f; std::string localePath; localePath.append("/") diff --git a/es-core/src/utils/LocalizationUtil.h b/es-core/src/utils/LocalizationUtil.h index 7bdfa9a53..f0c49e94e 100644 --- a/es-core/src/utils/LocalizationUtil.h +++ b/es-core/src/utils/LocalizationUtil.h @@ -21,7 +21,7 @@ namespace Utils namespace Localization { extern const std::vector> sSupportedLocales; - extern float sMenuScaleFactor; + extern float sMenuTitleScaleFactor; std::pair getLocale(); void setLocale(); diff --git a/locale/languages b/locale/languages index 110bf98ee..dd4a6675c 100644 --- a/locale/languages +++ b/locale/languages @@ -1 +1,2 @@ +en_US sv_SE