Place setup AP status below the WiFi address

This commit is contained in:
mikecarper committed 2026-09-08 16:56:10 -07:00
1 parent 86eabef4ff
commit bcc577ae98
2 files changed
+13 -10

No files matched your search

+4 -3
View File
@@ -96,9 +96,10 @@ Short-click to leave the page; hold the button on this page to start or stop
the setup AP. From USB, `start webconfig ap` starts the same setup session.
When the setup AP is inactive and the node has joined WiFi, this page shows
`WIFI CONNECTED` and an `IP <address>` row above `HOLD START AP`. The address appears
once assigned and clears when the station disconnects. While the setup AP is
active, the QR page shows the setup portal's address instead.
`WIFI CONNECTED`, `IP <address>`, `SETUP AP INACTIVE`, then `HOLD START AP` from
top to bottom. The address appears once assigned and clears when the station
disconnects. While the setup AP is active, the QR page shows the setup portal's
address instead.
## Regression checks
+9 -7
View File
@@ -143,16 +143,14 @@ static bool drawCompactCompanionWiFiSetupPage(
display.setCompactText(true);
display.setTextSize(1);
display.setColor(UIColor::primary_txt);
display.drawTextCentered(
display.width() / 2, 20,
setup_active ? "SETUP AP ACTIVE" : "SETUP AP INACTIVE");
// Put the connection and its address above the setup AP controls.
if (setup_active) {
display.drawTextEllipsized(0, 31, display.width(), setup_ssid);
display.drawTextEllipsized(0, 20, display.width(), setup_ssid);
char open_ip[22];
snprintf(open_ip, sizeof(open_ip), "OPEN %s", setup_ip);
display.setColor(UIColor::secondary_txt);
display.drawTextCentered(display.width() / 2, 42, open_ip);
display.drawTextCentered(display.width() / 2, 31, open_ip);
} else {
const bool show_ip = wifi_connected && wifi_ip[0] != 0;
const char* wifi_status = !wifi_enabled
@@ -160,15 +158,19 @@ static bool drawCompactCompanionWiFiSetupPage(
: wifi_connected
? "WIFI CONNECTED"
: wifi_configured ? "WIFI CONNECTING" : "WIFI NOT CONFIGURED";
display.drawTextCentered(display.width() / 2, 20, wifi_status);
display.setColor(UIColor::secondary_txt);
display.drawTextCentered(display.width() / 2, show_ip ? 31 : 37, wifi_status);
if (show_ip) {
char ip_line[19]; // "IP " plus the longest IPv4 address and terminator
snprintf(ip_line, sizeof(ip_line), "IP %s", wifi_ip);
display.drawTextCentered(display.width() / 2, 42, ip_line);
display.drawTextCentered(display.width() / 2, 31, ip_line);
}
}
display.drawTextCentered(
display.width() / 2, 42,
setup_active ? "SETUP AP ACTIVE" : "SETUP AP INACTIVE");
display.setColor(UIColor::warning_txt);
display.drawTextCentered(
display.width() / 2, 53,