dashboard: hide battery detail overlay instead of deleting it
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
static const char *DASHBOARD_VERSION = "0.1.95-refresh-recursion-fix";
|
static const char *DASHBOARD_VERSION = "0.1.96-hide-battery-overlay";
|
||||||
|
|
||||||
// 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";
|
||||||
|
|||||||
@@ -669,19 +669,20 @@ static void clear_battery_detail_refs()
|
|||||||
static void close_battery_detail_screen()
|
static void close_battery_detail_screen()
|
||||||
{
|
{
|
||||||
if (battery_detail_page != nullptr) {
|
if (battery_detail_page != nullptr) {
|
||||||
lv_obj_del(battery_detail_page);
|
lv_obj_add_flag(battery_detail_page, LV_OBJ_FLAG_HIDDEN);
|
||||||
battery_detail_page = nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
clear_battery_detail_refs();
|
|
||||||
current_dashboard_screen = SCREEN_OVERVIEW;
|
current_dashboard_screen = SCREEN_OVERVIEW;
|
||||||
|
refresh_dashboard_widgets();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_battery_detail_screen()
|
static void create_battery_detail_screen()
|
||||||
{
|
{
|
||||||
if (battery_detail_page != nullptr) {
|
if (battery_detail_page != nullptr) {
|
||||||
|
lv_obj_clear_flag(battery_detail_page, LV_OBJ_FLAG_HIDDEN);
|
||||||
lv_obj_move_foreground(battery_detail_page);
|
lv_obj_move_foreground(battery_detail_page);
|
||||||
current_dashboard_screen = SCREEN_BATTERY_DETAIL;
|
current_dashboard_screen = SCREEN_BATTERY_DETAIL;
|
||||||
|
update_battery_detail_widgets();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user