From 8ce820e001480b23a98e6064b9abd925ada7085c Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 25 Mar 2022 23:38:04 +0100 Subject: [PATCH] Fixed an issue where carousel shoulder button navigation was a bit inconsistent. --- .../components/primary/CarouselComponent.h | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/es-core/src/components/primary/CarouselComponent.h b/es-core/src/components/primary/CarouselComponent.h index eb3953fb2..55dee1e04 100644 --- a/es-core/src/components/primary/CarouselComponent.h +++ b/es-core/src/components/primary/CarouselComponent.h @@ -294,14 +294,26 @@ template bool CarouselComponent::input(InputConfig* config, Inpu if (config->isMappedLike("leftshoulder", input)) { if (mCancelTransitionsCallback) mCancelTransitionsCallback(); - List::listInput(-10); - return true; + if (mEntries.size() < 10 && getCursor() != 0) { + mTriggerJump = true; + return this->listFirstRow(); + } + else { + List::listInput(-10); + return true; + } } if (config->isMappedLike("rightshoulder", input)) { if (mCancelTransitionsCallback) mCancelTransitionsCallback(); - List::listInput(10); - return true; + if (mEntries.size() < 10 && getCursor() != static_cast(mEntries.size()) - 1) { + mTriggerJump = true; + return this->listLastRow(); + } + else { + List::listInput(10); + return true; + } } if (config->isMappedLike("lefttrigger", input)) { if (getCursor() == 0)