mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-01 02:11:57 +00:00
fix: review pass - storage unmount timeout, nav dial animates, dial text room, nearby name width, Simpson Enter with another key, GPS chip
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
e03fa7c084
commit
2ae55e97ac
@@ -494,13 +494,14 @@ void UITask::refreshNavBar() {
|
||||
if (!set) return;
|
||||
setTextFmt(_nav_title, "%s %s", navmap::s_tb.active() ? LV_SYMBOL_LOOP : person ? UI_SYMBOL_USERS : UI_SYMBOL_FLAG,
|
||||
name);
|
||||
if (navmap::s_dial) lv_obj_add_flag(navmap::s_dial, LV_OBJ_FLAG_HIDDEN); // setDial() below shows it again
|
||||
if (!pos) {
|
||||
if (navmap::s_dial) lv_obj_add_flag(navmap::s_dial, LV_OBJ_FLAG_HIDDEN);
|
||||
setText(_nav_info, "Position unknown (not shared recently)");
|
||||
return;
|
||||
}
|
||||
int32_t lat, lon;
|
||||
if (!_core->course.currentLocation(lat, lon)) {
|
||||
if (navmap::s_dial) lv_obj_add_flag(navmap::s_dial, LV_OBJ_FLAG_HIDDEN);
|
||||
setText(_nav_info, _core->gpsEnabled() || !_core->gpsAvailable()
|
||||
? "Waiting for a GPS fix..." : "GPS is off - tap the crosshair to turn it on");
|
||||
return;
|
||||
|
||||
@@ -59,7 +59,8 @@ static void stopWalk() {
|
||||
// be reading off it (from a map left open, or a prefetch), then close the map
|
||||
// pack it reads from.
|
||||
static void releaseMapFiles() {
|
||||
while (mapview::s_cache.busy()) { delay(5); mapview::pollTiles(); }
|
||||
const uint32_t t0 = millis(); // a task stuck on a failing card mustn't hang the UI
|
||||
while (mapview::s_cache.busy() && millis() - t0 < 3000) { delay(5); mapview::pollTiles(); }
|
||||
mapview::s_vpacks.closeOpen();
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ inline void draw(DisplayDriver& d,
|
||||
int dial_r = 0, dial_x = 0, dial_y = 0;
|
||||
if (!wide) {
|
||||
const int top = d.listStart();
|
||||
const int tw = (dw > 9 * cw ? dw : 9 * cw) + 4; // the widest of the lines at the left
|
||||
const int tw = (dw > 12 * cw ? dw : 12 * cw) + 4; // the widest of the lines at the left
|
||||
int r_side = (d.height() - top) / 2 - lh / 2 - 1; // room over the ring for the rose's N
|
||||
if (r_side > (d.width() - tw) / 2 - 1) r_side = (d.width() - tw) / 2 - 1;
|
||||
const int text_bottom = y + dist_h + dist_gap + lines * step;
|
||||
|
||||
@@ -1459,7 +1459,7 @@ public:
|
||||
snprintf(filt, sizeof(filt), "[%s]", typeName(e.type));
|
||||
}
|
||||
const int name_right = lw - reserve - 2 - rw - display.getCharWidth();
|
||||
int mqr = display.drawTextEllipsized(tx, y, name_right - tx, filt, sel);
|
||||
int mqr = display.drawTextEllipsized(tx, y, name_right > tx ? name_right - tx : 0, filt, sel);
|
||||
if (sel && mqr > 0) mq_delay = mqr;
|
||||
|
||||
display.setColor(sel ? UIColor::window_bkg : UIColor::primary_txt);
|
||||
|
||||
@@ -175,7 +175,7 @@ private:
|
||||
const bool sleeping = sensors.isGpsDutySleeping();
|
||||
if (f.place(lh + 5)) { // the fix as a chip, satellites used / in view
|
||||
const char* st = !on ? "OFF" : sleeping ? "SLEEP" : !fix ? "NO FIX" : (g && g->fix_mode == 2) ? "2D FIX" : "3D FIX";
|
||||
info::chip(d, 1, f.at, st, on && fix);
|
||||
info::chip(d, 1, f.at, st, on && fix && !sleeping);
|
||||
#ifdef STATUS_HAS_SKY
|
||||
if (g) snprintf(a, sizeof(a), "%d/%d sats", skyview::usedCount(*g), g->count);
|
||||
else
|
||||
|
||||
@@ -67,6 +67,12 @@ uint8_t SimpsonKeypad::poll() {
|
||||
_enter_long_sent = false;
|
||||
return SIMPSON_KEY_NONE;
|
||||
}
|
||||
if (key != SIMPSON_KEY_ENTER && _last_key == SIMPSON_KEY_ENTER && !_enter_long_sent) {
|
||||
// Another key arrived with Enter still down: the Enter counts now, the key on the next poll.
|
||||
_last_key = SIMPSON_KEY_NONE;
|
||||
_enter_pressed_at = 0;
|
||||
return SIMPSON_KEY_ENTER;
|
||||
}
|
||||
if (key == SIMPSON_KEY_ENTER && _last_key == SIMPSON_KEY_ENTER) {
|
||||
if (!_enter_long_sent && millis() - _enter_pressed_at >= SIMPSON_LONG_PRESS_MS) {
|
||||
_enter_long_sent = true;
|
||||
|
||||
Reference in New Issue
Block a user