#include "launcher_app.h" #include "ui/widgets.h" namespace roro { void LauncherApp::onEnter() { list_.setCount(static_cast(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