fix
This commit is contained in:
@ -65,7 +65,7 @@ void ApplyEmojiImageScale(lv_obj_t* image_obj, lv_obj_t* image_box, const lv_ima
|
||||
if (image_box != nullptr) {
|
||||
lv_obj_center(image_obj);
|
||||
}
|
||||
ESP_LOGI(TAG, "Emoji image scale=%ld reserved=%ld/%ld size=%ldx%ld -> %ldx%ld",
|
||||
ESP_LOGD(TAG, "Emoji image scale=%ld reserved=%ld/%ld size=%ldx%ld -> %ldx%ld",
|
||||
static_cast<long>(scale), static_cast<long>(top_reserved),
|
||||
static_cast<long>(bottom_reserved), static_cast<long>(image_width),
|
||||
static_cast<long>(image_height),
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
#include <string>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
#include <font_awesome.h>
|
||||
|
||||
#include "lvgl_display.h"
|
||||
@ -22,6 +23,21 @@ LvglDisplay::LvglDisplay() {
|
||||
LvglDisplay *display = static_cast<LvglDisplay*>(arg);
|
||||
DisplayLockGuard lock(display);
|
||||
lv_obj_add_flag(display->notification_label_, LV_OBJ_FLAG_HIDDEN);
|
||||
if (Application::GetInstance().GetDeviceState() == kDeviceStateIdle && display->time_label_ != nullptr) {
|
||||
time_t now = time(NULL);
|
||||
struct tm* tm = localtime(&now);
|
||||
if (tm->tm_year >= 2025 - 1900) {
|
||||
char time_str[16];
|
||||
strftime(time_str, sizeof(time_str), "%H:%M", tm);
|
||||
lv_label_set_text(display->time_label_, time_str);
|
||||
lv_obj_remove_flag(display->time_label_, LV_OBJ_FLAG_HIDDEN);
|
||||
lv_obj_add_flag(display->status_label_, LV_OBJ_FLAG_HIDDEN);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (display->time_label_ != nullptr) {
|
||||
lv_obj_add_flag(display->time_label_, LV_OBJ_FLAG_HIDDEN);
|
||||
}
|
||||
lv_obj_remove_flag(display->status_label_, LV_OBJ_FLAG_HIDDEN);
|
||||
},
|
||||
.arg = this,
|
||||
|
||||
Reference in New Issue
Block a user