diff --git a/es-core/src/components/ButtonComponent.cpp b/es-core/src/components/ButtonComponent.cpp index b15519de8..f7cbad97f 100644 --- a/es-core/src/components/ButtonComponent.cpp +++ b/es-core/src/components/ButtonComponent.cpp @@ -64,7 +64,10 @@ void ButtonComponent::onFocusLost() updateImage(); } -void ButtonComponent::setText(const std::string& text, const std::string& helpText, bool upperCase) +void ButtonComponent::setText(const std::string& text, + const std::string& helpText, + bool upperCase, + bool resize) { mText = upperCase ? Utils::String::toUpper(text) : text; mHelpText = helpText; @@ -74,10 +77,12 @@ void ButtonComponent::setText(const std::string& text, const std::string& helpTe const float minWidth {mFont->sizeText("DELETE").x + (12.0f * mRenderer->getScreenResolutionModifier())}; - setSize( - std::max(mTextCache->metrics.size.x + (12.0f * mRenderer->getScreenResolutionModifier()), - minWidth), - mTextCache->metrics.size.y); + if (resize) { + setSize(std::max(mTextCache->metrics.size.x + + (12.0f * mRenderer->getScreenResolutionModifier()), + minWidth), + mTextCache->metrics.size.y); + } updateHelpPrompts(); } diff --git a/es-core/src/components/ButtonComponent.h b/es-core/src/components/ButtonComponent.h index e15a5ad4d..afcbc1e21 100644 --- a/es-core/src/components/ButtonComponent.h +++ b/es-core/src/components/ButtonComponent.h @@ -27,7 +27,10 @@ public: void onFocusGained() override; void onFocusLost() override; - void setText(const std::string& text, const std::string& helpText, bool upperCase = true); + void setText(const std::string& text, + const std::string& helpText, + bool upperCase = true, + bool resize = true); const std::string& getText() const { return mText; } void setPressedFunc(std::function f) { mPressedFunc = f; }