mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-07 08:07:40 +03:00
Some checks are pending
CI / build (push) Waiting to run
## Summary **What is the goal of this PR?** Adds a setting to swap the front buttons. The default functionality are: Back/Confirm/Left/Right. When this setting is enabled they become: Left/Right/Back/Confirm. This makes it more comfortable to use when holding in your right hand since your thumb can more easily rest on the next button. The original firmware has a similar setting. **What changes are included?** - Add the new setting. - Create a mapper to dynamically switch the buttons based on the setting. - Use mapper on the various activity screens. - Update the button hints to reflect the swapped buttons. ## Additional Context Full disclosure: I used Codex CLI to put this PR together, but did review it to make sure it makes sense. Also tested on my device: https://share.cleanshot.com/k76891NY
31 lines
1.1 KiB
C++
31 lines
1.1 KiB
C++
#pragma once
|
|
#include <memory>
|
|
|
|
#include "../ActivityWithSubactivity.h"
|
|
|
|
class Epub;
|
|
class Xtc;
|
|
|
|
class ReaderActivity final : public ActivityWithSubactivity {
|
|
std::string initialBookPath;
|
|
std::string currentBookPath; // Track current book path for navigation
|
|
const std::function<void()> onGoBack;
|
|
static std::unique_ptr<Epub> loadEpub(const std::string& path);
|
|
static std::unique_ptr<Xtc> loadXtc(const std::string& path);
|
|
static bool isXtcFile(const std::string& path);
|
|
|
|
static std::string extractFolderPath(const std::string& filePath);
|
|
void onSelectBookFile(const std::string& path);
|
|
void onGoToFileSelection(const std::string& fromBookPath = "");
|
|
void onGoToEpubReader(std::unique_ptr<Epub> epub);
|
|
void onGoToXtcReader(std::unique_ptr<Xtc> xtc);
|
|
|
|
public:
|
|
explicit ReaderActivity(GfxRenderer& renderer, MappedInputManager& mappedInput, std::string initialBookPath,
|
|
const std::function<void()>& onGoBack)
|
|
: ActivityWithSubactivity("Reader", renderer, mappedInput),
|
|
initialBookPath(std::move(initialBookPath)),
|
|
onGoBack(onGoBack) {}
|
|
void onEnter() override;
|
|
};
|