diff --git a/es-app/src/guis/GuiMetaDataEd.cpp b/es-app/src/guis/GuiMetaDataEd.cpp index 256589d7c..ced319e6c 100644 --- a/es-app/src/guis/GuiMetaDataEd.cpp +++ b/es-app/src/guis/GuiMetaDataEd.cpp @@ -500,8 +500,8 @@ void GuiMetaDataEd::onSizeChanged() mGrid.setRowHeightPerc(3, (titleSubtitleSpacing * 1.2f) / mSize.y); mGrid.setRowHeightPerc(4, ((mList->getRowHeight(0) * 10.0f) + 2.0f) / mSize.y); - mGrid.setColWidthPerc(0, 0.08f); - mGrid.setColWidthPerc(2, 0.08f); + mGrid.setColWidthPerc(0, 0.07f); + mGrid.setColWidthPerc(2, 0.07f); mGrid.setSize(mSize); mBackground.fitTo(mSize, glm::vec3{}, glm::vec2{-32.0f, -32.0f}); diff --git a/es-core/src/Settings.cpp b/es-core/src/Settings.cpp index e7035633c..a69705ea9 100644 --- a/es-core/src/Settings.cpp +++ b/es-core/src/Settings.cpp @@ -181,7 +181,7 @@ void Settings::setDefaults() mBoolMap["SpecialCharsASCII"] = {false, false}; mBoolMap["ListScrollOverlay"] = {false, false}; mBoolMap["VirtualKeyboard"] = {true, true}; - mBoolMap["ScrollIndicators"] = {true, true}; + mBoolMap["ScrollIndicators"] = {false, false}; mBoolMap["FavoritesAddButton"] = {true, true}; mBoolMap["RandomAddButton"] = {false, false}; mBoolMap["GamelistFilters"] = {true, true}; diff --git a/es-core/src/components/MenuComponent.cpp b/es-core/src/components/MenuComponent.cpp index 4e5a82184..4f8a2dbf9 100644 --- a/es-core/src/components/MenuComponent.cpp +++ b/es-core/src/components/MenuComponent.cpp @@ -127,8 +127,8 @@ void MenuComponent::onSizeChanged() mGrid.setRowHeightPerc(1, TITLE_HEIGHT / mSize.y / 2.0f); mGrid.setRowHeightPerc(3, getButtonGridHeight() / mSize.y); - mGrid.setColWidthPerc(0, 0.08f); - mGrid.setColWidthPerc(2, 0.08f); + mGrid.setColWidthPerc(0, 0.07f); + mGrid.setColWidthPerc(2, 0.07f); mGrid.setSize(mSize); } diff --git a/es-core/src/components/ScrollIndicatorComponent.h b/es-core/src/components/ScrollIndicatorComponent.h index c378e2bc7..4c0f5801c 100644 --- a/es-core/src/components/ScrollIndicatorComponent.h +++ b/es-core/src/components/ScrollIndicatorComponent.h @@ -30,105 +30,118 @@ public: scrollUp->setOpacity(0); scrollDown->setOpacity(0); - if (!Settings::getInstance()->getBool("ScrollIndicators")) - return; + if (!Settings::getInstance()->getBool("ScrollIndicators")) { + // If the scroll indicators setting is disabled, then show a permanent down arrow + // symbol when the component list contains more entries than can fit on screen. + componentList.get()->setScrollIndicatorChangedCallback( + [scrollUp, scrollDown](ComponentList::ScrollIndicator state) { + if (state == ComponentList::SCROLL_UP || + state == ComponentList::SCROLL_UP_DOWN || + state == ComponentList::SCROLL_DOWN) { + scrollDown->setOpacity(255); + } + }); + } + else { + // If the scroll indicator setting is enabled, then also show the up and up/down + // combination and switch between these as the list is scrolled. + componentList.get()->setScrollIndicatorChangedCallback( + [this, scrollUp, scrollDown](ComponentList::ScrollIndicator state) { + float fadeInTime{FADE_IN_TIME}; - componentList.get()->setScrollIndicatorChangedCallback( - [this, scrollUp, scrollDown](ComponentList::ScrollIndicator state) { - float fadeInTime{FADE_IN_TIME}; + bool upFadeIn = false; + bool upFadeOut = false; + bool downFadeIn = false; + bool downFadeOut = false; - bool upFadeIn = false; - bool upFadeOut = false; - bool downFadeIn = false; - bool downFadeOut = false; + scrollUp->finishAnimation(0); + scrollDown->finishAnimation(0); - scrollUp->finishAnimation(0); - scrollDown->finishAnimation(0); + if (state == ComponentList::SCROLL_UP && + mPreviousScrollState == ComponentList::SCROLL_NONE) { + scrollUp->setOpacity(255); + } + else if (state == ComponentList::SCROLL_UP && + mPreviousScrollState == ComponentList::SCROLL_UP_DOWN) { + downFadeOut = true; + } + else if (state == ComponentList::SCROLL_UP && + mPreviousScrollState == ComponentList::SCROLL_DOWN) { + upFadeIn = true; + fadeInTime *= 1.5f; + scrollDown->setOpacity(0); + } + else if (state == ComponentList::SCROLL_UP_DOWN && + mPreviousScrollState == ComponentList::SCROLL_NONE) { + scrollUp->setOpacity(255); + scrollDown->setOpacity(255); + } + else if (state == ComponentList::SCROLL_UP_DOWN && + mPreviousScrollState == ComponentList::SCROLL_DOWN) { + upFadeIn = true; + } + else if (state == ComponentList::SCROLL_UP_DOWN && + mPreviousScrollState == ComponentList::SCROLL_UP) { + downFadeIn = true; + } + else if (state == ComponentList::SCROLL_DOWN && + mPreviousScrollState == ComponentList::SCROLL_NONE) { + scrollDown->setOpacity(255); + } + else if (state == ComponentList::SCROLL_DOWN && + mPreviousScrollState == ComponentList::SCROLL_UP_DOWN) { + upFadeOut = true; + } + else if (state == ComponentList::SCROLL_DOWN && + mPreviousScrollState == ComponentList::SCROLL_UP) { + downFadeIn = true; + fadeInTime *= 1.5f; + scrollUp->setOpacity(0); + } - if (state == ComponentList::SCROLL_UP && - mPreviousScrollState == ComponentList::SCROLL_NONE) { - scrollUp->setOpacity(255); - } - else if (state == ComponentList::SCROLL_UP && - mPreviousScrollState == ComponentList::SCROLL_UP_DOWN) { - downFadeOut = true; - } - else if (state == ComponentList::SCROLL_UP && - mPreviousScrollState == ComponentList::SCROLL_DOWN) { - upFadeIn = true; - fadeInTime *= 1.5f; - scrollDown->setOpacity(0); - } - else if (state == ComponentList::SCROLL_UP_DOWN && - mPreviousScrollState == ComponentList::SCROLL_NONE) { - scrollUp->setOpacity(255); - scrollDown->setOpacity(255); - } - else if (state == ComponentList::SCROLL_UP_DOWN && - mPreviousScrollState == ComponentList::SCROLL_DOWN) { - upFadeIn = true; - } - else if (state == ComponentList::SCROLL_UP_DOWN && - mPreviousScrollState == ComponentList::SCROLL_UP) { - downFadeIn = true; - } - else if (state == ComponentList::SCROLL_DOWN && - mPreviousScrollState == ComponentList::SCROLL_NONE) { - scrollDown->setOpacity(255); - } - else if (state == ComponentList::SCROLL_DOWN && - mPreviousScrollState == ComponentList::SCROLL_UP_DOWN) { - upFadeOut = true; - } - else if (state == ComponentList::SCROLL_DOWN && - mPreviousScrollState == ComponentList::SCROLL_UP) { - downFadeIn = true; - fadeInTime *= 1.5f; - scrollUp->setOpacity(0); - } + if (upFadeIn) { + auto upFadeInFunc = [scrollUp](float t) { + scrollUp->setOpacity( + static_cast(glm::mix(0.0f, 1.0f, t) * 255)); + }; + scrollUp->setAnimation( + new LambdaAnimation(upFadeInFunc, static_cast(fadeInTime)), 0, + nullptr, false); + } - if (upFadeIn) { - auto upFadeInFunc = [scrollUp](float t) { - scrollUp->setOpacity( - static_cast(glm::mix(0.0f, 1.0f, t) * 255)); - }; - scrollUp->setAnimation( - new LambdaAnimation(upFadeInFunc, static_cast(fadeInTime)), 0, nullptr, - false); - } + if (upFadeOut) { + auto upFadeOutFunc = [scrollUp](float t) { + scrollUp->setOpacity( + static_cast(glm::mix(0.0f, 1.0f, t) * 255)); + }; + scrollUp->setAnimation( + new LambdaAnimation(upFadeOutFunc, static_cast(fadeInTime)), 0, + nullptr, true); + } - if (upFadeOut) { - auto upFadeOutFunc = [scrollUp](float t) { - scrollUp->setOpacity( - static_cast(glm::mix(0.0f, 1.0f, t) * 255)); - }; - scrollUp->setAnimation( - new LambdaAnimation(upFadeOutFunc, static_cast(fadeInTime)), 0, - nullptr, true); - } + if (downFadeIn) { + auto downFadeInFunc = [scrollDown](float t) { + scrollDown->setOpacity( + static_cast(glm::mix(0.0f, 1.0f, t) * 255)); + }; + scrollDown->setAnimation( + new LambdaAnimation(downFadeInFunc, static_cast(fadeInTime)), 0, + nullptr, false); + } - if (downFadeIn) { - auto downFadeInFunc = [scrollDown](float t) { - scrollDown->setOpacity( - static_cast(glm::mix(0.0f, 1.0f, t) * 255)); - }; - scrollDown->setAnimation( - new LambdaAnimation(downFadeInFunc, static_cast(fadeInTime)), 0, - nullptr, false); - } + if (downFadeOut) { + auto downFadeOutFunc = [scrollDown](float t) { + scrollDown->setOpacity( + static_cast(glm::mix(0.0f, 1.0f, t) * 255)); + }; + scrollDown->setAnimation( + new LambdaAnimation(downFadeOutFunc, static_cast(fadeInTime)), 0, + nullptr, true); + } - if (downFadeOut) { - auto downFadeOutFunc = [scrollDown](float t) { - scrollDown->setOpacity( - static_cast(glm::mix(0.0f, 1.0f, t) * 255)); - }; - scrollDown->setAnimation( - new LambdaAnimation(downFadeOutFunc, static_cast(fadeInTime)), 0, - nullptr, true); - } - - mPreviousScrollState = state; - }); + mPreviousScrollState = state; + }); + } } private: