Files
roro9stack/src/ui/screen.h
T
twislaandClaude Opus 5.5 37335b4829 UI: seven themes, each dark and light, chosen in the Settings
Settings > Theme and Settings > Light or dark pick the colours of every
screen (issue #10): roro9stack (the website's, the default), Catppuccin,
Dracula, Nord, ANSI terminal, Gruvbox and Solarized.

- A palette is 14 roles (lib/ui/src/palette.h). theme::kText and the
  others are now references into the one in use, so the Apps are
  unchanged; the main loop applies it when a Setting changes.
- Every colour is one the RGB332 frame buffer holds exactly: the themes'
  own were rounded, and those that fell together or lost contrast were
  picked by hand. test_palette checks exactness and 18 contrast ratios
  for each palette.
- The Sky view's constellation colours come from the theme.
- `theme [0-6] [light|dark]` on the consoles.

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

27 lines
918 B
C++

#pragma once
#include "app_manager.h"
#include "canvas.h"
#include "widgets.h"
namespace roro {
// Composes the frame (Status Bar, foreground App, Toast) off-screen and pushes it to the display.
class Screen {
public:
bool begin(); // allocates the frame buffer (~32 KB at 8-bit colour)
void render(AppManager& apps, const StatusInfo& status, const Toast* toast);
// Takes over the screen while a Firmware Update is received or about to restart.
void renderUpdate(const std::string& title, const std::string& detail, int percent);
Canvas& canvas() { return canvas_; }
// The colours changed: an App that keeps what it drew has to draw it all again.
void invalidate() { lost_ = true; }
private:
Canvas canvas_;
const App* lastApp_ = nullptr; // for an App that keeps what it drew (App::retainsContent)
bool lost_ = true, overlayWas_ = false;
};
} // namespace roro