From 027af497d5637daeab0e6257a5aecebe65c86630 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Wed, 9 Feb 2022 18:16:15 +0100 Subject: [PATCH] Fixed an issue where VideoComponent static images were not fading out correctly in the gamelist view. --- es-app/src/views/GamelistView.cpp | 17 ++++++++++++++--- es-core/src/components/VideoComponent.h | 1 + 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/es-app/src/views/GamelistView.cpp b/es-app/src/views/GamelistView.cpp index c16d632b9..c70db67c4 100644 --- a/es-app/src/views/GamelistView.cpp +++ b/es-app/src/views/GamelistView.cpp @@ -205,10 +205,17 @@ void GamelistView::update(int deltaTime) } for (auto& video : mVideoComponents) { - if (!mVideoPlaying) - video->onHide(); - else if (mVideoPlaying && !video->isVideoPaused() && !mWindow->isScreensaverActive()) + if (!mVideoPlaying) { + if (!video->getScrollHide()) + video->onHide(); + else if (!video->hasStaticImage()) + video->onHide(); + else if (video->getOpacity() == 0) + video->onHide(); + } + else if (mVideoPlaying && !video->isVideoPaused() && !mWindow->isScreensaverActive()) { video->onShow(); + } if (ViewController::getInstance()->getGameLaunchTriggered() && video->isAnimationPlaying(0)) video->finishAnimation(0); @@ -733,6 +740,10 @@ void GamelistView::updateInfoPanel() if (image->getScrollHide()) comps.emplace_back(image.get()); } + for (auto& video : mVideoComponents) { + if (video->getScrollHide()) + comps.emplace_back(video.get()); + } for (auto& badge : mBadgeComponents) { if (badge->getScrollHide()) comps.emplace_back(badge.get()); diff --git a/es-core/src/components/VideoComponent.h b/es-core/src/components/VideoComponent.h index a12ab2eb3..f18d5522b 100644 --- a/es-core/src/components/VideoComponent.h +++ b/es-core/src/components/VideoComponent.h @@ -49,6 +49,7 @@ public: void setOpacity(unsigned char opacity) override { mOpacity = opacity; } bool hasStaticVideo() { return !mConfig.staticVideoPath.empty(); } + bool hasStaticImage() { return mStaticImage.getTextureSize() != glm::ivec2 {0, 0}; } void onShow() override; void onHide() override;