From 8103bef3b8b4efaa0dab82b36f2b5568ca6d3afb Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 12 Feb 2022 17:50:44 +0100 Subject: [PATCH] Fixed a minor animation glitch in the gamelist view. Also removed the explicit setDisplayRelative() call which made it impossible to override this theme setting. --- es-app/src/views/GamelistLegacy.h | 8 +++++--- es-app/src/views/GamelistView.cpp | 9 +++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/es-app/src/views/GamelistLegacy.h b/es-app/src/views/GamelistLegacy.h index 3fab1be7f..2d13ef8c7 100644 --- a/es-app/src/views/GamelistLegacy.h +++ b/es-app/src/views/GamelistLegacy.h @@ -555,7 +555,11 @@ void GamelistView::legacyUpdateInfoPanel() comps.push_back(mRatingComponents.front().get()); for (auto it = comps.cbegin(); it != comps.cend(); ++it) { - GuiComponent* comp = *it; + GuiComponent* comp {*it}; + if (!fadingOut && !comp->isAnimationPlaying(0)) { + comp->setOpacity(1.0f); + continue; + } // 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) || @@ -635,9 +639,7 @@ void GamelistView::legacyInitMDValues() } mDateTimeComponents[LegacyDateTime::MD_RELEASEDATE]->setFont(defaultFont); - // mDateTimeComponents[LegacyDateTime::MD_RELEASEDATE]->setColor(0xFFFFFFFF); mDateTimeComponents[LegacyDateTime::MD_LASTPLAYED]->setFont(defaultFont); - // mDateTimeComponents[LegacyDateTime::MD_LASTPLAYED]->setColor(0xFFFFFFFF); values.emplace_back(mRatingComponents.front().get()); values.emplace_back(mDateTimeComponents[LegacyDateTime::MD_RELEASEDATE].get()); diff --git a/es-app/src/views/GamelistView.cpp b/es-app/src/views/GamelistView.cpp index 14d47e88a..5d00fb1e6 100644 --- a/es-app/src/views/GamelistView.cpp +++ b/es-app/src/views/GamelistView.cpp @@ -714,14 +714,11 @@ void GamelistView::updateInfoPanel() } else if (metadata == "md_lastplayed") { date->setValue(file->metadata.get("lastplayed")); - date->setDisplayRelative(true); } else { date->setValue("19700101T000000"); } } - - fadingOut = false; } std::vector comps; @@ -756,7 +753,11 @@ void GamelistView::updateInfoPanel() } for (auto it = comps.cbegin(); it != comps.cend(); ++it) { - GuiComponent* comp = *it; + GuiComponent* comp {*it}; + if (!fadingOut && !comp->isAnimationPlaying(0)) { + comp->setOpacity(1.0f); + continue; + } // 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) ||