mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Removed some forced uppercase conversions
This commit is contained in:
parent
661bb5d539
commit
1700bb195c
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
//
|
||||
// ES-DE
|
||||
// ES-DE Frontend
|
||||
// ButtonComponent.cpp
|
||||
//
|
||||
// Basic on/off button.
|
||||
|
|
|
@ -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<void()>& func = nullptr,
|
||||
bool upperCase = true,
|
||||
bool upperCase = false,
|
||||
bool flatStyle = false);
|
||||
|
||||
void onSizeChanged() override;
|
||||
|
|
|
@ -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>& 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<void()>& callback)
|
||||
{
|
||||
mButtons.push_back(
|
||||
std::make_shared<ButtonComponent>(Utils::String::toUpper(name), helpText, callback));
|
||||
mButtons.push_back(std::make_shared<ButtonComponent>(name, helpText, callback));
|
||||
updateGrid();
|
||||
updateSize();
|
||||
}
|
||||
|
|
|
@ -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<TextComponent>(Utils::String::toUpper(label),
|
||||
Font::get(FONT_SIZE_MEDIUM),
|
||||
mMenuColorPrimary),
|
||||
true);
|
||||
row.addElement(
|
||||
std::make_shared<TextComponent>(label, Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary),
|
||||
true);
|
||||
row.addElement(comp, false, invert_when_selected);
|
||||
addRow(row, setCursorHere);
|
||||
}
|
||||
|
|
|
@ -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<TextComponent>(
|
||||
Utils::String::toUpper(it->name), font, mMenuColorPrimary);
|
||||
auto textComponent =
|
||||
std::make_shared<TextComponent>(it->name, font, mMenuColorPrimary);
|
||||
row.addElement(textComponent, true);
|
||||
|
||||
if (mParent->mMultiExclusiveSelect && hasSelectedRow && !(*it).selected) {
|
||||
|
|
Loading…
Reference in a new issue