Public Access
Help: Fn+h lists the keys of the screen you're on, and no screen names its keys any more (#69)
Fn+h on any screen, text fields included, and ? outside Text Entry, open a panel over the content area: the screen's own keys, then the ones that work everywhere. Every App declares its keys for the state it is in (pages, viewers, dialogs and text fields answer for themselves); the App manager opens the panel and takes every key while it is open. About 30 hint lines are gone, from every App. What stays on a screen is state. The first-start Setup keeps its hints and teaches the key; a device set up before gets one Toast, once. The guide and the FAQ open with it. `key help` over the consoles. 476 host tests (8 new). Checked on the device with key help and screenshots: the Launcher, all nine Apps and several of their states. 8.5 KB of flash and 40 bytes of static RAM. Decisions Q196 to Q203 in docs/milestones/U1.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
+18
-2
@@ -173,6 +173,23 @@ std::string NotesApp::titleOf(int row) {
|
||||
return files::fitName(list_.name(notes_[row]), kTitleChars); // an empty note, or not a text
|
||||
}
|
||||
|
||||
void NotesApp::help(std::vector<KeyHelp>& out) const {
|
||||
if (view_ == View::Edit) return editor_.help(out);
|
||||
if (dialog_) return help::dialog(out);
|
||||
if (view_ == View::Name) return help::textEntry(out, "rename the file");
|
||||
if (view_ == View::NoMemory) return;
|
||||
help::list(out, "open the note");
|
||||
out.push_back({", /", "a page up, down"});
|
||||
out.push_back({"n", "a new note"});
|
||||
out.push_back({"r", "rename its file"});
|
||||
out.push_back({"d Del", "delete it"});
|
||||
out.push_back({"s", "sort: newest, or by name"});
|
||||
}
|
||||
|
||||
const char* NotesApp::helpTitle() const {
|
||||
return view_ == View::Edit ? "Notes: the editor" : view_ == View::Name ? "Notes: a file name" : nullptr;
|
||||
}
|
||||
|
||||
bool NotesApp::onKey(const KeyEvent& e) {
|
||||
requestRedraw();
|
||||
if (view_ == View::NoMemory) return false;
|
||||
@@ -315,7 +332,6 @@ void NotesApp::draw(Canvas& c) {
|
||||
} else if (notes_.empty()) {
|
||||
c.setTextColor(theme::kMuted);
|
||||
c.drawString("No notes yet.", 4, rows.y + 4);
|
||||
c.drawString("n starts one.", 4, rows.y + 4 + theme::kLineHeight);
|
||||
} else {
|
||||
readTitles();
|
||||
widgets::list(
|
||||
@@ -329,7 +345,7 @@ void NotesApp::draw(Canvas& c) {
|
||||
c.setFont(&fonts::small);
|
||||
bool showMessage = !message_.empty() && millis() - messageMs_ < kMessageMs;
|
||||
c.setTextColor(showMessage ? theme::kWarning : theme::kMuted);
|
||||
c.drawString(showMessage ? message_.c_str() : "n: new Enter: open r: name d: del s: sort", 4, area.y + area.h - 9);
|
||||
if (showMessage) c.drawString(message_.c_str(), 4, area.y + area.h - 9);
|
||||
|
||||
if (view_ == View::Name) {
|
||||
theme::Rect box{16, 44, theme::kWidth - 32, 48};
|
||||
|
||||
Reference in New Issue
Block a user