Compare commits

..

1 Commits

Author SHA1 Message Date
Jonas Diemer
5b4cb90420
Merge 95b7f8008c into 6d68466891 2026-01-19 21:50:44 +00:00
2 changed files with 14 additions and 13 deletions

View File

@ -1,7 +1,5 @@
#include "EpubReaderMenuActivity.h"
#include <GfxRenderer.h>
#include "fontIds.h"
void EpubReaderMenuActivity::onEnter() {
@ -48,7 +46,7 @@ void EpubReaderMenuActivity::loop() {
// Use local variables for items we need to check after potential deletion
if (mappedInput.wasReleased(MappedInputManager::Button::Up) ||
mappedInput.wasReleased(MappedInputManager::Button::Left)) {
mappedInput.wasReleased(MappedInputManager::Button::Left) ) {
selectedIndex = (selectedIndex + menuItems.size() - 1) % menuItems.size();
updateRequired = true;
} else if (mappedInput.wasReleased(MappedInputManager::Button::Down) ||

View File

@ -3,21 +3,23 @@
#include <freertos/FreeRTOS.h>
#include <freertos/semphr.h>
#include <freertos/task.h>
#include <functional>
#include <string>
#include <vector>
#include <string>
#include "../ActivityWithSubactivity.h"
#include "MappedInputManager.h"
#include "../ActivityWithSubactivity.h"
class EpubReaderMenuActivity final : public ActivityWithSubactivity {
public:
enum class MenuAction { SELECT_CHAPTER, GO_HOME, DELETE_CACHE };
explicit EpubReaderMenuActivity(GfxRenderer& renderer, MappedInputManager& mappedInput,
const std::function<void()>& onBack, const std::function<void(MenuAction)>& onAction)
: ActivityWithSubactivity("EpubReaderMenu", renderer, mappedInput), onBack(onBack), onAction(onAction) {}
const std::function<void()>& onBack,
const std::function<void(MenuAction)>& onAction)
: ActivityWithSubactivity("EpubReaderMenu", renderer, mappedInput),
onBack(onBack),
onAction(onAction) {}
void onEnter() override;
void onExit() override;
@ -29,7 +31,8 @@ class EpubReaderMenuActivity final : public ActivityWithSubactivity {
std::string label;
};
const std::vector<MenuItem> menuItems = {{MenuAction::SELECT_CHAPTER, "Select Chapter"},
const std::vector<MenuItem> menuItems = {
{MenuAction::SELECT_CHAPTER, "Select Chapter"},
{MenuAction::GO_HOME, "Go Home"},
{MenuAction::DELETE_CACHE, "Delete Book Cache"}};