feat: mcp sleep

This commit is contained in:
0Xiao0
2026-06-17 11:16:45 +08:00
parent 6a66014a19
commit 154ce461d7
10 changed files with 153 additions and 17 deletions

View File

@ -29,6 +29,9 @@ lv_coord_t ObjectHeight(lv_obj_t* obj) {
if (obj == nullptr) {
return 0;
}
if (lv_obj_has_flag(obj, LV_OBJ_FLAG_HIDDEN)) {
return 0;
}
lv_obj_update_layout(obj);
return lv_obj_get_height(obj);
}
@ -1202,8 +1205,9 @@ void LcdDisplay::SetEmotion(const char* emotion) {
}
DisplayLockGuard lock(this);
lv_coord_t top_reserved = ObjectHeight(top_bar_);
lv_coord_t bottom_reserved = ObjectHeight(status_bar_) + ObjectHeight(bottom_bar_);
bool use_full_screen_center = strcmp(emotion, "neutral") == 0;
lv_coord_t top_reserved = use_full_screen_center ? 0 : ObjectHeight(top_bar_);
lv_coord_t bottom_reserved = use_full_screen_center ? 0 : ObjectHeight(status_bar_) + ObjectHeight(bottom_bar_);
auto apply_emoji_layout = [this, top_reserved, bottom_reserved](const lv_image_dsc_t* image_dsc) {
ApplyEmojiImageScale(emoji_image_, emoji_box_, image_dsc, top_reserved, bottom_reserved);
};