Public Access
UI: the website's colours, on every screen
The theme takes the website's palette, each a colour the RGB332 frame buffer holds exactly: cyan for the accent, a selected row and a chosen button in cyan with dark blue text, a slate Status Bar (the grey it asked for was shown as a dull olive), the website's orange for warnings and its pink for messages. "Good" (a Fix, the quietest channel) keeps a green of its own, which the website doesn't have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0162FokPdvY2KsS4NBfwyWPk
This commit is contained in:
+12
-7
@@ -4,15 +4,20 @@
|
||||
|
||||
namespace roro::theme {
|
||||
|
||||
// RGB565
|
||||
// The website's palette (site/static/css/site.css, its dark side), as RGB565. Every one is a colour
|
||||
// the 8-bit frame buffer (RGB332) holds exactly, so what is asked for is what is shown.
|
||||
constexpr uint16_t kBackground = 0x0000;
|
||||
constexpr uint16_t kText = 0xFFFF;
|
||||
constexpr uint16_t kMuted = 0x8410; // grey
|
||||
constexpr uint16_t kAccent = 0x2CBF; // teal-blue
|
||||
constexpr uint16_t kSelection = 0x1A6F; // darker accent behind selected rows
|
||||
constexpr uint16_t kBar = 0x2104; // Status Bar background
|
||||
constexpr uint16_t kWarning = 0xFC60; // orange
|
||||
constexpr uint16_t kMessage = 0x3666; // green
|
||||
constexpr uint16_t kAccent = 0x06DF; // cyan, #00dbff: what is chosen, what is live
|
||||
constexpr uint16_t kOnAccent = 0x000A; // dark blue, #000055: text and pictures on a cyan fill
|
||||
constexpr uint16_t kSelection = kAccent; // behind a selected row, whose text is kOnAccent
|
||||
constexpr uint16_t kMuted = 0x9495; // grey, #9292aa: between the website's two
|
||||
constexpr uint16_t kFaint = 0x4A4A; // slate, #494955: grid lines, what stays behind
|
||||
constexpr uint16_t kBar = kFaint; // Status Bar background
|
||||
constexpr uint16_t kBarMuted = 0xB5B5; // light grey, #b6b6aa: what is idle, on the bar
|
||||
constexpr uint16_t kWarning = 0xFC80; // orange, #ff9200
|
||||
constexpr uint16_t kMessage = 0xFC9F; // pink, #ff92ff: someone wrote
|
||||
constexpr uint16_t kGood = 0x4ECA; // green, #49db55: a Fix, the best of a set (not on the website)
|
||||
|
||||
constexpr int kWidth = 240;
|
||||
constexpr int kHeight = 135;
|
||||
|
||||
+12
-12
@@ -32,43 +32,43 @@ void statusBar(Canvas& c, const StatusInfo& info) {
|
||||
if (info.unread > 0) right("[" + std::to_string(info.unread) + "]", kMessage);
|
||||
if (info.batteryPercent >= 0)
|
||||
right(std::to_string(info.batteryPercent) + "%", info.batteryPercent <= 15 ? kWarning : kText);
|
||||
if (info.sdPresent) right("SD", info.sdLevel >= 80 ? kWarning : kMuted);
|
||||
if (info.sdPresent) right("SD", info.sdLevel >= 80 ? kWarning : kBarMuted);
|
||||
switch (info.wifi) {
|
||||
case StatusInfo::Wifi::Connected: {
|
||||
// Three signal bars, then the label.
|
||||
for (int i = 0; i < 3; i++) {
|
||||
int h = 2 + 2 * i;
|
||||
c.fillRect(x - 10 + 4 * i, 9 - h, 3, h, i < info.wifiBars ? kText : kMuted);
|
||||
c.fillRect(x - 10 + 4 * i, 9 - h, 3, h, i < info.wifiBars ? kText : kBackground);
|
||||
}
|
||||
x -= 14;
|
||||
right("W", kText);
|
||||
break;
|
||||
}
|
||||
case StatusInfo::Wifi::Searching: right("W?", kMuted); break;
|
||||
case StatusInfo::Wifi::Searching: right("W?", kBarMuted); break;
|
||||
case StatusInfo::Wifi::Monitoring: right("MON", kAccent); break;
|
||||
case StatusInfo::Wifi::None: break;
|
||||
}
|
||||
switch (info.vpn) { // Q252: there while the tunnel is wanted, bright once the peer has answered
|
||||
case StatusInfo::Vpn::Trying: right("VPN", kMuted); break;
|
||||
case StatusInfo::Vpn::Trying: right("VPN", kBarMuted); break;
|
||||
case StatusInfo::Vpn::Up: right("VPN", kAccent); break;
|
||||
case StatusInfo::Vpn::Off: break;
|
||||
}
|
||||
if (info.ssh) right("SSH", kAccent); // Q260: a session goes on, whatever App is in front
|
||||
switch (info.debug) { // Q190: there while the console listens, bright with someone connected
|
||||
case StatusInfo::Debug::On: right("DBG", kMuted); break;
|
||||
case StatusInfo::Debug::On: right("DBG", kBarMuted); break;
|
||||
case StatusInfo::Debug::Client: right("DBG", kAccent); break;
|
||||
case StatusInfo::Debug::Off: break;
|
||||
}
|
||||
if (info.tracking) right("REC", kWarning);
|
||||
if (info.capturing) right("CAP", kWarning);
|
||||
switch (info.radio) { // Q101: muted while listening, bright for a moment on each packet
|
||||
case StatusInfo::Radio::Listening: right("L", kMuted); break;
|
||||
case StatusInfo::Radio::Listening: right("L", kBarMuted); break;
|
||||
case StatusInfo::Radio::Packet: right("L", kAccent); break;
|
||||
case StatusInfo::Radio::Sweep: right("SW", kMuted); break; // the Sniffer is paused
|
||||
case StatusInfo::Radio::Sweep: right("SW", kBarMuted); break; // the Sniffer is paused
|
||||
case StatusInfo::Radio::None: break;
|
||||
}
|
||||
switch (info.gnss) { // Q61: muted while searching, normal with a Fix, the count with a 3D Fix
|
||||
case StatusInfo::Gnss::Searching: right("G", kMuted); break;
|
||||
case StatusInfo::Gnss::Searching: right("G", kBarMuted); break;
|
||||
case StatusInfo::Gnss::TwoD: right("G", kText); break;
|
||||
case StatusInfo::Gnss::ThreeD: right("G" + std::to_string(info.gnssSatellites), kText); break;
|
||||
case StatusInfo::Gnss::None: break;
|
||||
@@ -88,10 +88,10 @@ void list(Canvas& c, const ListModel& model, Rect area, const std::function<std:
|
||||
int y = area.y + row * kLineHeight;
|
||||
bool selected = i == model.selected();
|
||||
if (selected) c.fillRect(area.x, y, area.w - 4, kLineHeight, kSelection);
|
||||
c.setTextColor(kText);
|
||||
c.setTextColor(selected ? kOnAccent : kText);
|
||||
c.drawString(label(i).c_str(), area.x + 4, y + 1);
|
||||
if (value) {
|
||||
c.setTextColor(selected ? kText : kMuted);
|
||||
c.setTextColor(selected ? kOnAccent : kMuted);
|
||||
c.setTextDatum(top_right);
|
||||
c.drawString(value(i).c_str(), area.x + area.w - 8, y + 1);
|
||||
c.setTextDatum(top_left);
|
||||
@@ -159,7 +159,7 @@ void dialog(Canvas& c, const std::string& title, const std::string& message, con
|
||||
bool selected = i == model.selected();
|
||||
if (selected) c.fillRect(x, box.y + box.h - 19, w, 15, kAccent);
|
||||
else c.drawRect(x, box.y + box.h - 19, w, 15, kMuted);
|
||||
c.setTextColor(selected ? kBackground : kText);
|
||||
c.setTextColor(selected ? kOnAccent : kText);
|
||||
c.drawString(buttons[i].c_str(), x + 6, box.y + box.h - 17);
|
||||
x -= 6;
|
||||
}
|
||||
@@ -174,7 +174,7 @@ void toast(Canvas& c, const Toast& t) {
|
||||
if (w > kWidth - 8) w = kWidth - 8;
|
||||
int x = (kWidth - w) / 2, y = kHeight - 22;
|
||||
c.fillRect(x, y, w, 18, color);
|
||||
c.setTextColor(kBackground);
|
||||
c.setTextColor(kOnAccent);
|
||||
c.setTextDatum(top_left);
|
||||
c.setClipRect(x + 4, y, w - 8, 18);
|
||||
c.drawString(t.text.c_str(), x + 8, y + 3);
|
||||
|
||||
Reference in New Issue
Block a user