diff --git a/es-core/src/ThemeData.cpp b/es-core/src/ThemeData.cpp index 0378fed8e..13bb974df 100644 --- a/es-core/src/ThemeData.cpp +++ b/es-core/src/ThemeData.cpp @@ -153,6 +153,7 @@ std::map> {"textHorizontalScrolling", BOOLEAN}, {"textHorizontalScrollSpeed", FLOAT}, {"textHorizontalScrollDelay", FLOAT}, + {"textHorizontalScrollGap", FLOAT}, {"fontPath", PATH}, {"fontSize", FLOAT}, {"letterCase", STRING}, @@ -239,6 +240,7 @@ std::map> {"textHorizontalScrolling", BOOLEAN}, {"textHorizontalScrollSpeed", FLOAT}, {"textHorizontalScrollDelay", FLOAT}, + {"textHorizontalScrollGap", FLOAT}, {"fontPath", PATH}, {"fontSize", FLOAT}, {"horizontalAlignment", STRING}, diff --git a/es-core/src/components/primary/CarouselComponent.h b/es-core/src/components/primary/CarouselComponent.h index bcf1062ee..06022ca48 100644 --- a/es-core/src/components/primary/CarouselComponent.h +++ b/es-core/src/components/primary/CarouselComponent.h @@ -203,6 +203,7 @@ private: bool mTextHorizontalScrolling; float mTextHorizontalScrollSpeed; float mTextHorizontalScrollDelay; + float mTextHorizontalScrollGap; std::shared_ptr mFont; LetterCase mLetterCase; LetterCase mLetterCaseAutoCollections; @@ -277,6 +278,7 @@ CarouselComponent::CarouselComponent() , mTextHorizontalScrolling {false} , mTextHorizontalScrollSpeed {1.0f} , mTextHorizontalScrollDelay {3000.0f} + , mTextHorizontalScrollGap {1.5f} , mFont {Font::get(FONT_SIZE_LARGE_FIXED)} , mLetterCase {LetterCase::NONE} , mLetterCaseAutoCollections {LetterCase::UNDEFINED} @@ -366,7 +368,7 @@ void CarouselComponent::addEntry(Entry& entry, const std::shared_ptr= 1.0f ? mItemScale : 1.0f)), 0x00000000, mLineSpacing, mTextRelativeScale, mTextHorizontalScrolling, mTextHorizontalScrollSpeed, - mTextHorizontalScrollDelay, 1.0f); + mTextHorizontalScrollDelay, mTextHorizontalScrollGap); if (!mGamelistView) text->setValue(entry.name); text->setColor(mTextColor); @@ -1691,6 +1693,11 @@ void CarouselComponent::applyTheme(const std::shared_ptr& theme, glm::clamp(elem->get("textHorizontalScrollDelay"), 0.0f, 10.0f) * 1000.0f; } + if (elem->has("textHorizontalScrollGap")) { + mTextHorizontalScrollGap = + glm::clamp(elem->get("textHorizontalScrollGap"), 0.1f, 5.0f); + } + if (elem->has("lineSpacing")) mLineSpacing = glm::clamp(elem->get("lineSpacing"), 0.5f, 3.0f); diff --git a/es-core/src/components/primary/TextListComponent.h b/es-core/src/components/primary/TextListComponent.h index 2612134a9..b0f167137 100644 --- a/es-core/src/components/primary/TextListComponent.h +++ b/es-core/src/components/primary/TextListComponent.h @@ -139,6 +139,7 @@ private: bool mHorizontalScrolling; float mHorizontalScrollSpeed; float mHorizontalScrollDelay; + float mTextHorizontalScrollGap; PrimaryAlignment mAlignment; float mHorizontalMargin; LetterCase mLetterCase; @@ -176,6 +177,7 @@ TextListComponent::TextListComponent() , mHorizontalScrolling {true} , mHorizontalScrollSpeed {1.0f} , mHorizontalScrollDelay {3000.0f} + , mTextHorizontalScrollGap {1.5f} , mAlignment {PrimaryAlignment::ALIGN_CENTER} , mHorizontalMargin {0.0f} , mLetterCase {LetterCase::NONE} @@ -204,6 +206,7 @@ void TextListComponent::addEntry(Entry& entry, const std::shared_ptrsetHorizontalScrollingSpeedMultiplier(mHorizontalScrollSpeed); entry.data.entryName->setHorizontalScrollingDelay(mHorizontalScrollDelay); + entry.data.entryName->setHorizontalScrollingGap(mTextHorizontalScrollGap); entry.data.entryName->setHorizontalScrolling(true); textSize.x = mSize.x - (mHorizontalMargin * 2.0f); entry.data.entryName->setSize(textSize); @@ -494,6 +497,11 @@ void TextListComponent::applyTheme(const std::shared_ptr& theme, glm::clamp(elem->get("textHorizontalScrollDelay"), 0.0f, 10.0f) * 1000.0f; } + if (elem->has("textHorizontalScrollGap")) { + mTextHorizontalScrollGap = + glm::clamp(elem->get("textHorizontalScrollGap"), 0.1f, 5.0f); + } + mFont = Font::getFromTheme(elem, properties, mFont, 0.0f, false); const float selectorHeight {mFont->getHeight(mLineSpacing)};