mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-26 08:05:38 +00:00
Changed to scaling the menu title per language instead of the overall menu
This commit is contained in:
parent
6b541ad501
commit
1df2641e0c
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
#include "components/ButtonComponent.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_VERT_PADDING Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 0.915f
|
||||||
#define BUTTON_GRID_HORIZ_PADDING Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 0.283f
|
#define BUTTON_GRID_HORIZ_PADDING Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 0.283f
|
||||||
|
@ -114,11 +113,9 @@ void MenuComponent::updateSize()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float width {std::min(
|
float width {std::min(mRenderer->getScreenHeight() * 1.05f,
|
||||||
mRenderer->getScreenHeight() * 1.05f * Utils::Localization::sMenuScaleFactor,
|
mRenderer->getScreenWidth() *
|
||||||
mRenderer->getScreenWidth() * (mRenderer->getIsVerticalOrientation() ?
|
(mRenderer->getIsVerticalOrientation() ? 0.94f : 0.90f))};
|
||||||
0.94f * Utils::Localization::sMenuScaleFactor :
|
|
||||||
0.90f * Utils::Localization::sMenuScaleFactor))};
|
|
||||||
|
|
||||||
setSize(width, height);
|
setSize(width, height);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "components/NinePatchComponent.h"
|
#include "components/NinePatchComponent.h"
|
||||||
#include "components/ScrollIndicatorComponent.h"
|
#include "components/ScrollIndicatorComponent.h"
|
||||||
#include "components/TextComponent.h"
|
#include "components/TextComponent.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
#include "utils/StringUtil.h"
|
#include "utils/StringUtil.h"
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
@ -24,7 +25,8 @@ class MenuComponent : public GuiComponent
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MenuComponent(std::string title,
|
MenuComponent(std::string title,
|
||||||
const std::shared_ptr<Font>& titleFont = Font::get(FONT_SIZE_LARGE));
|
const std::shared_ptr<Font>& titleFont =
|
||||||
|
Font::get(FONT_SIZE_LARGE * Utils::Localization::sMenuTitleScaleFactor));
|
||||||
virtual ~MenuComponent();
|
virtual ~MenuComponent();
|
||||||
|
|
||||||
void save();
|
void save();
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace Utils
|
||||||
{
|
{
|
||||||
const std::vector<std::pair<std::string, std::string>> sSupportedLocales {{{"en"}, {"US"}},
|
const std::vector<std::pair<std::string, std::string>> sSupportedLocales {{{"en"}, {"US"}},
|
||||||
{{"sv"}, {"SE"}}};
|
{{"sv"}, {"SE"}}};
|
||||||
float sMenuScaleFactor {1.0f};
|
float sMenuTitleScaleFactor {1.0f};
|
||||||
|
|
||||||
std::pair<std::string, std::string> getLocale()
|
std::pair<std::string, std::string> getLocale()
|
||||||
{
|
{
|
||||||
|
@ -90,7 +90,7 @@ namespace Utils
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sMenuScaleFactor = 1.0f;
|
sMenuTitleScaleFactor = 1.0f;
|
||||||
std::string languageSetting {Settings::getInstance()->getString("ApplicationLanguage")};
|
std::string languageSetting {Settings::getInstance()->getString("ApplicationLanguage")};
|
||||||
std::vector<std::string> localeVector;
|
std::vector<std::string> localeVector;
|
||||||
std::pair<std::string, std::string> localePair;
|
std::pair<std::string, std::string> localePair;
|
||||||
|
@ -138,9 +138,9 @@ namespace Utils
|
||||||
locale = "en_US";
|
locale = "en_US";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Language-specific menu scale factor.
|
// Language-specific menu title scale factor.
|
||||||
if (localePair.first == "sv")
|
if (localePair.first == "sv")
|
||||||
sMenuScaleFactor = 1.02f;
|
sMenuTitleScaleFactor = 0.86f;
|
||||||
|
|
||||||
std::string localePath;
|
std::string localePath;
|
||||||
localePath.append("/")
|
localePath.append("/")
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace Utils
|
||||||
namespace Localization
|
namespace Localization
|
||||||
{
|
{
|
||||||
extern const std::vector<std::pair<std::string, std::string>> sSupportedLocales;
|
extern const std::vector<std::pair<std::string, std::string>> sSupportedLocales;
|
||||||
extern float sMenuScaleFactor;
|
extern float sMenuTitleScaleFactor;
|
||||||
|
|
||||||
std::pair<std::string, std::string> getLocale();
|
std::pair<std::string, std::string> getLocale();
|
||||||
void setLocale();
|
void setLocale();
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
en_US
|
||||||
sv_SE
|
sv_SE
|
||||||
|
|
Loading…
Reference in a new issue