Normalize button hints (#130)

## Summary

This creates a `renderer.drawButtonHints` to make all of the "hints"
over buttons to match the home screen.

## Additional Context

* Add any other information that might be helpful for the reviewer
(e.g., performance implications, potential risks, specific areas to
focus on).

---------

Co-authored-by: Dave Allie <dave@daveallie.com>
This commit is contained in:
Brendan O'Leary
2025-12-25 19:54:02 -05:00
committed by GitHub
parent dc7544d944
commit e3c1e28b8f
8 changed files with 33 additions and 21 deletions

View File

@@ -337,8 +337,6 @@ void CrossPointWebServerActivity::render() const {
}
void CrossPointWebServerActivity::renderServerRunning() const {
const auto pageHeight = renderer.getScreenHeight();
// Use consistent line spacing
constexpr int LINE_SPACING = 28; // Space between lines
@@ -389,5 +387,5 @@ void CrossPointWebServerActivity::renderServerRunning() const {
renderer.drawCenteredText(SMALL_FONT_ID, startY + LINE_SPACING * 4, "Open this URL in your browser", true, REGULAR);
}
renderer.drawCenteredText(SMALL_FONT_ID, pageHeight - 30, "Press BACK to exit", true, REGULAR);
renderer.drawButtonHints(UI_FONT_ID, "« Exit", "", "", "");
}

View File

@@ -122,7 +122,7 @@ void NetworkModeSelectionActivity::render() const {
}
// Draw help text at bottom
renderer.drawCenteredText(SMALL_FONT_ID, pageHeight - 30, "Press OK to select, BACK to cancel", true, REGULAR);
renderer.drawButtonHints(UI_FONT_ID, "« Back", "Select", "", "");
renderer.displayBuffer();
}

View File

@@ -548,11 +548,12 @@ void WifiSelectionActivity::renderNetworkList() const {
// Show network count
char countStr[32];
snprintf(countStr, sizeof(countStr), "%zu networks found", networks.size());
renderer.drawText(SMALL_FONT_ID, 20, pageHeight - 45, countStr);
renderer.drawText(SMALL_FONT_ID, 20, pageHeight - 90, countStr);
}
// Draw help text
renderer.drawText(SMALL_FONT_ID, 20, pageHeight - 30, "OK: Connect | * = Encrypted | + = Saved");
renderer.drawText(SMALL_FONT_ID, 20, pageHeight - 75, "* = Encrypted | + = Saved");
renderer.drawButtonHints(UI_FONT_ID, "« Back", "Connect", "", "");
}
void WifiSelectionActivity::renderPasswordEntry() const {