From b53b0e13499a05553736d1f578142d016611a3d7 Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Wed, 30 Sep 2026 23:23:04 +0200 Subject: [PATCH] feat(l2): vector map off unless built with -D MAP_VECTOR The vector map isn't finished: without the flag it stays off whatever was saved, and its switch and the Vector regions row are gone from the map tools. The code stays. Co-Authored-By: Claude Opus 5.5 --- examples/companion_radio/ui-lvgl/LvglPort.h | 7 ++++++- examples/companion_radio/ui-lvgl/NavMap.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/companion_radio/ui-lvgl/LvglPort.h b/examples/companion_radio/ui-lvgl/LvglPort.h index 81fd72c7..aeb7767f 100644 --- a/examples/companion_radio/ui-lvgl/LvglPort.h +++ b/examples/companion_radio/ui-lvgl/LvglPort.h @@ -878,8 +878,13 @@ static void setLiveTiles(bool on) { nvs::putBool("mc_wifi", "live", on); } // Map tools > Hiking trails: the Waymarked Trails overlay over the map. static bool trailsOn() { return nvs::getBool("mc_ui", "trails", false); } static void setTrailsOn(bool on) { nvs::putBool("mc_ui", "trails", on); } -// Map tools > Vector map (test). +// Map tools > Vector map (test). Unfinished: on only in a -D MAP_VECTOR build, +// off (and its switch gone) otherwise, whatever was saved. +#ifdef MAP_VECTOR static bool vectorOn() { return nvs::getBool("mc_ui", "vector", false); } +#else +static bool vectorOn() { return false; } +#endif static void setVectorOn(bool on) { nvs::putBool("mc_ui", "vector", on); } // Screen-lock PIN (Settings > Display > Screen PIN): digits, "" = none. diff --git a/examples/companion_radio/ui-lvgl/NavMap.h b/examples/companion_radio/ui-lvgl/NavMap.h index f4449855..1e60bc27 100644 --- a/examples/companion_radio/ui-lvgl/NavMap.h +++ b/examples/companion_radio/ui-lvgl/NavMap.h @@ -1028,6 +1028,7 @@ void UITask::navToolsPopup() { lv_obj_t* tsw = switchRow(g, "Hiking trails", "Marked routes in their colours", nullptr); if (lvport::trailsOn()) lv_obj_add_state(tsw, LV_STATE_CHECKED); lv_obj_add_event_cb(tsw, onTrails, LV_EVENT_VALUE_CHANGED, NULL); +#ifdef MAP_VECTOR // unfinished (LvglPort.h vectorOn) lv_obj_t* vsw = switchRow(g, "Vector map (test)", "Drawn on the device: trails, contours", nullptr); if (lvport::vectorOn()) lv_obj_add_state(vsw, LV_STATE_CHECKED); lv_obj_add_event_cb(vsw, onVectorMap, LV_EVENT_VALUE_CHANGED, NULL); @@ -1035,6 +1036,7 @@ void UITask::navToolsPopup() { int nv = mapview::s_vpacks.count(); snprintf(vr, sizeof(vr), nv ? "%d on the card" : "None - packs go in /vmap", nv); listRow(g, "Vector regions", vr, onNavTool, (void*)(uintptr_t)navmap::TL_REGIONS); +#endif refreshNavTools(); }