Files
Crosspoint/src/activities/Activity.cpp
T
Uri Tauber 08461c08e7 fix: small QoL: return to the last selected menu location (#1629)
## Summary

* **What is the goal of this PR?** Small UX improvement to the Home
screen by preserving the last selected cursor position when returning to
it.

It supersedes #985 and #1103, which are both significantly outdated and
hundreds of commits behind master.

---

### AI Usage

Did you use AI tools to help write this code? _**< YES >**_
2026-05-19 08:41:39 -05:00

25 lines
935 B
C++

#include "Activity.h"
#include "ActivityManager.h"
void Activity::onEnter() { LOG_DBG("ACT", "Entering activity: %s", name.c_str()); }
void Activity::onExit() { LOG_DBG("ACT", "Exiting activity: %s", name.c_str()); }
void Activity::requestUpdate(bool immediate) { activityManager.requestUpdate(immediate); }
void Activity::requestUpdateAndWait() { activityManager.requestUpdateAndWait(); }
void Activity::onGoHome(HomeMenuItem item) { activityManager.goHome(item); }
void Activity::onSelectBook(const std::string& path) { activityManager.goToReader(path); }
void Activity::startActivityForResult(std::unique_ptr<Activity>&& activity, ActivityResultHandler resultHandler) {
this->resultHandler = std::move(resultHandler);
activityManager.pushActivity(std::move(activity));
}
void Activity::setResult(ActivityResult&& result) { this->result = std::move(result); }
void Activity::finish() { activityManager.popActivity(); }