Public Access
The Launcher shows the Apps as a 4 x 3 grid of 32 x 32 icons, the selected one's name under it (issue #9). The icons are the website's own, doubled, and two drawn the same way for SSH and the Shell; they are PNGs in assets/icons, turned into arrays by scripts/make_icons.py, which CI checks. The selected tile is the website's: dark blue on cyan, with notched corners. - GridModel (lib/ui, host-tested) holds the selection and the scrolling. - App::badge(): a dot on the tile for unread IRC messages, a Track recording, a Capture running, an SSH session open. - Settings > Launcher: Grid or List. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0162FokPdvY2KsS4NBfwyWPk
43 lines
1.3 KiB
C++
43 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "settings.h"
|
|
|
|
namespace roro {
|
|
|
|
// What the Settings App lists: one row per user-facing setting (plus sub-pages), with readable
|
|
// values, choice lists and validation messages. Rendering and navigation live in the App.
|
|
class SettingsMenu {
|
|
public:
|
|
enum class Row { LongName, ShortName, Region, Timezone, Brightness, DimTimeout, OffTimeout, Launcher, Sound, Gnss, GnssQuiet, Coordinates, ProbeMacs, Wifi, CheckUpdates, Firmware, Vpn, DebugConsole, About };
|
|
enum class Kind { Text, Choice, Toggle, Slider, Page };
|
|
|
|
explicit SettingsMenu(Settings& settings) : settings_(settings) {}
|
|
|
|
int count() const;
|
|
Row row(int i) const;
|
|
Kind kind(int i) const;
|
|
std::string label(int i) const;
|
|
std::string value(int i) const;
|
|
|
|
// Choice rows
|
|
std::vector<std::string> choices(int i) const;
|
|
int currentChoice(int i) const; // -1 if the current value isn't one of the choices
|
|
std::string choose(int i, int choice); // empty on success, otherwise why it was refused
|
|
|
|
// Toggle and Slider rows
|
|
void toggle(int i);
|
|
void adjust(int i, int direction);
|
|
|
|
// Text rows
|
|
int maxBytes(int i) const;
|
|
std::string setText(int i, const std::string& text); // empty on success, otherwise why
|
|
|
|
private:
|
|
Settings& settings_;
|
|
};
|
|
|
|
} // namespace roro
|