Files
roro9stack/src/apps/launcher_app.cpp
T
twislaandClaude Opus 5.5 879cb0d0b6 Add widget kit, input layer with Compose Key, Launcher and demo apps
Steps 5 and 6 of M0.
- lib/ui (host-tested): ListModel, LineEditor (UTF-8, byte-limited),
  wrapText, ToastQueue, DialogModel
- lib/input (host-tested): KeyMapper turns keyboard state into logical
  keys (Fn arrows, ` Back, Fn+` Home) and composes accents with opt
- src/ui: off-screen 16-bit frame pushed in one transfer (fixes the
  flicker), Status Bar, list, text, line editor, dialog, Toast widgets,
  Notifier (Toast + beep + LED), vendored public-domain Latin-1 fonts
- Apps: minimal Launcher, Widget demo, Diagnostics (SD erase now
  behind a confirmation dialog)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
2026-10-02 10:35:48 +02:00

28 lines
751 B
C++

#include "launcher_app.h"
#include "ui/widgets.h"
namespace roro {
void LauncherApp::onEnter() { list_.setCount(static_cast<int>(manager_->visibleApps().size())); }
bool LauncherApp::onKey(const KeyEvent& e) {
switch (e.key) {
case Key::Up: list_.up(); break;
case Key::Down: list_.down(); break;
case Key::Select:
if (list_.selected() >= 0) manager_->open(manager_->visibleApps()[list_.selected()]->id);
return true;
default: return false;
}
requestRedraw();
return true;
}
void LauncherApp::draw(Canvas& c) {
auto apps = manager_->visibleApps();
widgets::list(c, list_, theme::kContent, [&](int i) { return std::string(apps[i]->title); });
}
} // namespace roro