diff --git a/es-app/src/views/GamelistLegacy.h b/es-app/src/views/GamelistLegacy.h index 03c665048..90627210b 100644 --- a/es-app/src/views/GamelistLegacy.h +++ b/es-app/src/views/GamelistLegacy.h @@ -626,10 +626,9 @@ void GamelistView::legacyUpdateInfoPanel(const CursorState& state) for (auto it = comps.cbegin(); it != comps.cend(); ++it) { GuiComponent* comp {*it}; - // An animation is playing, then animate if reverse != fadingOut. - // An animation is not playing, then animate if opacity != our target opacity. if ((comp->isAnimationPlaying(0) && comp->isAnimationReversed(0) != fadingOut) || - (!comp->isAnimationPlaying(0) && comp->getOpacity() != (fadingOut ? 0.0f : 1.0f))) { + (!comp->isAnimationPlaying(0) && + comp->getOpacity() != (fadingOut ? 0.0f : comp->getColorOpacity()))) { auto func = [comp](float t) { comp->setOpacity(glm::mix(0.0f, 1.0f, t)); }; comp->setAnimation(new LambdaAnimation(func, 150), 0, nullptr, fadingOut); } diff --git a/es-app/src/views/GamelistView.cpp b/es-app/src/views/GamelistView.cpp index 670f72555..18384cb7c 100644 --- a/es-app/src/views/GamelistView.cpp +++ b/es-app/src/views/GamelistView.cpp @@ -781,10 +781,9 @@ void GamelistView::updateInfoPanel(const CursorState& state) for (auto it = comps.cbegin(); it != comps.cend(); ++it) { GuiComponent* comp {*it}; - // An animation is playing, then animate if reverse != fadingOut. - // An animation is not playing, then animate if opacity != our target opacity. if ((comp->isAnimationPlaying(0) && comp->isAnimationReversed(0) != fadingOut) || - (!comp->isAnimationPlaying(0) && comp->getOpacity() != (fadingOut ? 0.0f : 1.0f))) { + (!comp->isAnimationPlaying(0) && + comp->getOpacity() != (fadingOut ? 0.0f : comp->getColorOpacity()))) { auto func = [comp](float t) { comp->setOpacity(glm::mix(0.0f, 1.0f, t)); }; comp->setAnimation(new LambdaAnimation(func, 150), 0, nullptr, fadingOut); } diff --git a/es-core/src/GuiComponent.h b/es-core/src/GuiComponent.h index 9b1e95b3c..14cb8a4c1 100644 --- a/es-core/src/GuiComponent.h +++ b/es-core/src/GuiComponent.h @@ -193,6 +193,7 @@ public: virtual bool isListScrolling() { return false; } virtual void stopListScrolling() {} virtual const float getOpacity() const { return mOpacity; } + virtual const float getColorOpacity() const { return 1.0f; } virtual void setOpacity(float opacity); virtual float getSaturation() const { return static_cast(mColor); } virtual void setSaturation(float saturation) { mSaturation = saturation; } diff --git a/es-core/src/components/TextComponent.h b/es-core/src/components/TextComponent.h index 67f09c889..9558f4320 100644 --- a/es-core/src/components/TextComponent.h +++ b/es-core/src/components/TextComponent.h @@ -61,6 +61,8 @@ public: { return static_cast((mColor & 0x000000FF) / 255.0f); } + float const getColorOpacity() const override { return mColorOpacity; } + void setOpacity(float opacity) override; void setDimming(float dimming) override;