From 8d1b86a8933bdd6d9b5b2e7fbdc2fa05a4f5d0d1 Mon Sep 17 00:00:00 2001 From: Jan Ivanov Date: Tue, 12 May 2026 15:06:35 +0300 Subject: [PATCH] feat: add next / prev labels to bmp viewer (#1852) ## Summary Bind `prev` / `next` functionality to the left and right buttons in BMP Viewer and adds labels image ## Additional Context * Add any other information that might be helpful for the reviewer (e.g., performance implications, potential risks, specific areas to focus on). --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**NO**_ --- src/activities/util/BmpViewerActivity.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/activities/util/BmpViewerActivity.cpp b/src/activities/util/BmpViewerActivity.cpp index 4a29086b..0387bc55 100644 --- a/src/activities/util/BmpViewerActivity.cpp +++ b/src/activities/util/BmpViewerActivity.cpp @@ -97,7 +97,12 @@ void BmpViewerActivity::onEnter() { } // 4. Prepare Rendering - const auto labels = mappedInput.mapLabels(tr(STR_BACK), tr(STR_SET_SLEEP_COVER), "", ""); + bool hasPrevious = (siblingImages.size() > 1 && currentImageIndex > 0); + bool hasNext = (siblingImages.size() > 1 && currentImageIndex != -1 && + currentImageIndex < static_cast(siblingImages.size()) - 1); + + const auto labels = + mappedInput.mapLabels(tr(STR_BACK), tr(STR_SET_SLEEP_COVER), (hasPrevious ? "<" : ""), (hasNext ? ">" : "")); GUI.fillPopupProgress(renderer, popupRect, 50); @@ -185,7 +190,8 @@ void BmpViewerActivity::loop() { return; } - if (mappedInput.wasReleased(MappedInputManager::Button::Up)) { + if (mappedInput.wasReleased(MappedInputManager::Button::Left) || + mappedInput.wasReleased(MappedInputManager::Button::Up)) { if (siblingImages.size() > 1 && currentImageIndex > 0) { currentImageIndex--; std::string dirPath = FsHelpers::extractFolderPath(filePath); @@ -196,7 +202,8 @@ void BmpViewerActivity::loop() { return; } - if (mappedInput.wasReleased(MappedInputManager::Button::Down)) { + if (mappedInput.wasReleased(MappedInputManager::Button::Right) || + mappedInput.wasReleased(MappedInputManager::Button::Down)) { if (siblingImages.size() > 1 && currentImageIndex != -1 && currentImageIndex < static_cast(siblingImages.size()) - 1) { currentImageIndex++;