dashboard: add missing double tap nav helper
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
static const char *DASHBOARD_VERSION = "0.1.83-doubletap-target-fix";
|
static const char *DASHBOARD_VERSION = "0.1.84-doubletap-helper-fix";
|
||||||
|
|
||||||
// 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";
|
||||||
|
|||||||
@@ -572,6 +572,14 @@ static void battery_nav_doubletap_cb(lv_event_t *event)
|
|||||||
last_click_ms = now_ms;
|
last_click_ms = now_ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void add_doubletap_nav_target(lv_obj_t *obj, DashboardScreen target)
|
||||||
|
{
|
||||||
|
if (obj == nullptr) return;
|
||||||
|
lv_obj_add_flag(obj, LV_OBJ_FLAG_CLICKABLE);
|
||||||
|
lv_obj_add_event_cb(obj, battery_nav_doubletap_cb, LV_EVENT_RELEASED, (void *)target);
|
||||||
|
lv_obj_add_event_cb(obj, battery_nav_doubletap_cb, LV_EVENT_SHORT_CLICKED, (void *)target);
|
||||||
|
}
|
||||||
|
|
||||||
static void dashboard_root_event_cb(lv_event_t *event)
|
static void dashboard_root_event_cb(lv_event_t *event)
|
||||||
{
|
{
|
||||||
if (lv_event_get_code(event) != LV_EVENT_GESTURE) return;
|
if (lv_event_get_code(event) != LV_EVENT_GESTURE) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user