feat: mcp sleep
This commit is contained in:
@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user