dashboard: use lvgl c image assets

This commit is contained in:
2026-06-11 04:44:46 -06:00
parent 517a719ac7
commit 53f0b6ee5b
10 changed files with 5185 additions and 13 deletions
@@ -7,8 +7,8 @@
#include <lvgl.h>
#include "lvgl_v8_port.h"
#include "dashboard_config.h"
#include "thermometer-water.h"
#include "gas-station.h"
extern const lv_img_dsc_t gas_station;
extern const lv_img_dsc_t thermometer_water;
#include "dashboard_status_model.h"
using namespace esp_panel::drivers;
@@ -1252,10 +1252,8 @@ static void create_overland_overview_screen()
lv_obj_t *coolant_icon = lv_img_create(vehicle_card);
lv_img_set_src(coolant_icon, &thermometer_water);
lv_img_set_zoom(coolant_icon, 100); // 150px source -> ~40px display
lv_obj_set_style_img_recolor(coolant_icon, lv_color_hex(0xFFFFFF), 0);
lv_obj_set_style_img_recolor_opa(coolant_icon, LV_OPA_100, 0);
lv_obj_align(coolant_icon, LV_ALIGN_TOP_LEFT, 8, 8);
lv_img_set_zoom(coolant_icon, 100);
lv_obj_align(coolant_icon, LV_ALIGN_TOP_LEFT, 4, 4);
#if LV_USE_METER
vehicle_coolant_meter = lv_meter_create(vehicle_card);
@@ -1292,15 +1290,13 @@ static void create_overland_overview_screen()
lv_obj_t *fuel_icon = lv_img_create(vehicle_card);
lv_img_set_src(fuel_icon, &gas_station);
lv_img_set_zoom(fuel_icon, 90); // 150px source -> ~32px display
lv_obj_set_style_img_recolor(fuel_icon, lv_color_hex(0xFFFFFF), 0);
lv_obj_set_style_img_recolor_opa(fuel_icon, LV_OPA_100, 0);
lv_obj_align(fuel_icon, LV_ALIGN_BOTTOM_LEFT, 8, -10);
lv_img_set_zoom(fuel_icon, 90);
lv_obj_align(fuel_icon, LV_ALIGN_BOTTOM_LEFT, 4, -6);
vehicle_fuel_bar = lv_bar_create(vehicle_card);
lv_obj_add_event_cb(vehicle_fuel_bar, fuel_bar_draw_value_cb, LV_EVENT_DRAW_PART_END, NULL);
lv_obj_set_size(vehicle_fuel_bar, 206, 22);
lv_obj_align(vehicle_fuel_bar, LV_ALIGN_BOTTOM_LEFT, 64, -20);
lv_obj_align(vehicle_fuel_bar, LV_ALIGN_BOTTOM_LEFT, 74, -20);
lv_bar_set_range(vehicle_fuel_bar, 0, 100);
lv_bar_set_value(vehicle_fuel_bar, 72, LV_ANIM_OFF);
lv_obj_set_style_radius(vehicle_fuel_bar, 3, 0);
@@ -1318,7 +1314,7 @@ static void create_overland_overview_screen()
lv_obj_set_style_bg_color(tick, lv_color_hex(0x7D8996), 0);
lv_obj_set_style_border_width(tick, 0, 0);
lv_obj_set_style_radius(tick, 0, 0);
lv_obj_align(tick, LV_ALIGN_BOTTOM_LEFT, 64 + (i * 48), -17);
lv_obj_align(tick, LV_ALIGN_BOTTOM_LEFT, 74 + (i * 44), -17);
}
vehicle_fuel_value_label = lv_label_create(vehicle_card);