From f99552a45863ec70fc9922ae73f2d084ba664054 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 5 Mar 2023 17:51:16 +0100 Subject: [PATCH] Fixed an issue where cursor callbacks were not always executed in CarouselComponent. Also added an immediate return from onDemandTextureLoad() in the carousel and grid components if there are no entries. --- es-core/src/components/primary/CarouselComponent.h | 5 ++++- es-core/src/components/primary/GridComponent.h | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/es-core/src/components/primary/CarouselComponent.h b/es-core/src/components/primary/CarouselComponent.h index e14555e4b..5c6ad3c66 100644 --- a/es-core/src/components/primary/CarouselComponent.h +++ b/es-core/src/components/primary/CarouselComponent.h @@ -474,6 +474,9 @@ void CarouselComponent::updateEntry(Entry& entry, const std::shared_ptr void CarouselComponent::onDemandTextureLoad() { if constexpr (std::is_same_v) { + if (size() == 0) + return; + if (mImageTypes.empty()) mImageTypes.emplace_back("marquee"); @@ -1981,7 +1984,7 @@ template void CarouselComponent::onCursorChanged(const CursorSta GuiComponent::setAnimation(anim, 0, nullptr, false, 0); - if (mCursorChangedCallback && !mEntries.empty()) + if (mCursorChangedCallback) mCursorChangedCallback(state); } diff --git a/es-core/src/components/primary/GridComponent.h b/es-core/src/components/primary/GridComponent.h index ae4de03a7..562cff02d 100644 --- a/es-core/src/components/primary/GridComponent.h +++ b/es-core/src/components/primary/GridComponent.h @@ -410,6 +410,9 @@ void GridComponent::updateEntry(Entry& entry, const std::shared_ptr void GridComponent::onDemandTextureLoad() { if constexpr (std::is_same_v) { + if (size() == 0) + return; + if (mImageTypes.empty()) mImageTypes.emplace_back("marquee");