dashboard: use double tap into battery page and back gesture out

This commit is contained in:
2026-06-19 00:26:09 -06:00
parent bac159f4a4
commit 83814f13b6
2 changed files with 5 additions and 5 deletions
@@ -1,6 +1,6 @@
#pragma once #pragma once
static const char *DASHBOARD_VERSION = "0.1.106-diag-style-battery-doubleclick"; static const char *DASHBOARD_VERSION = "0.1.107-battery-back-gesture";
// Update these if your Cargo ESP AP credentials are different. // Update these if your Cargo ESP AP credentials are different.
//static const char *CARGO_WIFI_SSID = "OverlandController"; //static const char *CARGO_WIFI_SSID = "OverlandController";
@@ -606,9 +606,9 @@ static void dashboard_root_event_cb(lv_event_t *event)
lv_dir_t dir = lv_indev_get_gesture_dir(indev); lv_dir_t dir = lv_indev_get_gesture_dir(indev);
if (current_dashboard_screen == SCREEN_OVERVIEW && dir == LV_DIR_RIGHT) { // Only Battery Detail uses swipe navigation.
queue_dashboard_page_switch(SCREEN_BATTERY_DETAIL); // Left-to-right swipe acts like a smartphone back gesture.
} else if (current_dashboard_screen == SCREEN_BATTERY_DETAIL && dir == LV_DIR_LEFT) { if (current_dashboard_screen == SCREEN_BATTERY_DETAIL && dir == LV_DIR_RIGHT) {
queue_dashboard_page_switch(SCREEN_OVERVIEW); queue_dashboard_page_switch(SCREEN_OVERVIEW);
} }
} }
@@ -724,7 +724,7 @@ static void create_battery_detail_screen()
lv_obj_align(title, LV_ALIGN_LEFT_MID, 22, 0); lv_obj_align(title, LV_ALIGN_LEFT_MID, 22, 0);
lv_obj_t *hint = lv_label_create(system_card); lv_obj_t *hint = lv_label_create(system_card);
lv_label_set_text(hint, "Swipe left for main"); lv_label_set_text(hint, "Swipe right to go back");
lv_obj_set_style_text_color(hint, lv_color_hex(0xB8C0C8), 0); lv_obj_set_style_text_color(hint, lv_color_hex(0xB8C0C8), 0);
lv_obj_set_style_text_font(hint, &lv_font_montserrat_26, 0); lv_obj_set_style_text_font(hint, &lv_font_montserrat_26, 0);
lv_obj_align(hint, LV_ALIGN_RIGHT_MID, -18, 0); lv_obj_align(hint, LV_ALIGN_RIGHT_MID, -18, 0);