Fixed a minor animation glitch in the gamelist view.

Also removed the explicit setDisplayRelative() call which made it impossible to override this theme setting.
This commit is contained in:
Leon Styhre 2022-02-12 17:50:44 +01:00
parent 1cba6e202e
commit 8103bef3b8
2 changed files with 10 additions and 7 deletions

View file

@ -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());

View file

@ -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<GuiComponent*> 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) ||