forked from xiaozhi/xiaozhi-esp32
@@ -326,11 +326,15 @@ void LcdDisplay::SetupUI() {
|
||||
lv_obj_set_style_pad_left(status_bar_, 2, 0);
|
||||
lv_obj_set_style_pad_right(status_bar_, 2, 0);
|
||||
lv_obj_set_scrollbar_mode(status_bar_, LV_SCROLLBAR_MODE_OFF);
|
||||
// 设置状态栏的内容垂直居中
|
||||
lv_obj_set_flex_align(status_bar_, LV_FLEX_ALIGN_SPACE_BETWEEN, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
|
||||
|
||||
network_label_ = lv_label_create(status_bar_);
|
||||
lv_label_set_text(network_label_, "");
|
||||
lv_obj_set_style_text_font(network_label_, fonts_.icon_font, 0);
|
||||
lv_obj_set_style_text_color(network_label_, current_theme.text, 0);
|
||||
// 创建emotion_label_在状态栏最左侧
|
||||
emotion_label_ = lv_label_create(status_bar_);
|
||||
lv_obj_set_style_text_font(emotion_label_, &font_awesome_30_4, 0);
|
||||
lv_obj_set_style_text_color(emotion_label_, current_theme.text, 0);
|
||||
lv_label_set_text(emotion_label_, FONT_AWESOME_AI_CHIP);
|
||||
lv_obj_set_style_margin_right(emotion_label_, 5, 0); // 添加右边距,与后面的元素分隔
|
||||
|
||||
notification_label_ = lv_label_create(status_bar_);
|
||||
lv_obj_set_flex_grow(notification_label_, 1);
|
||||
@@ -351,17 +355,17 @@ void LcdDisplay::SetupUI() {
|
||||
lv_obj_set_style_text_font(mute_label_, fonts_.icon_font, 0);
|
||||
lv_obj_set_style_text_color(mute_label_, current_theme.text, 0);
|
||||
|
||||
network_label_ = lv_label_create(status_bar_);
|
||||
lv_label_set_text(network_label_, "");
|
||||
lv_obj_set_style_text_font(network_label_, fonts_.icon_font, 0);
|
||||
lv_obj_set_style_text_color(network_label_, current_theme.text, 0);
|
||||
lv_obj_set_style_margin_left(network_label_, 5, 0); // 添加左边距,与前面的元素分隔
|
||||
|
||||
battery_label_ = lv_label_create(status_bar_);
|
||||
lv_label_set_text(battery_label_, "");
|
||||
lv_obj_set_style_text_font(battery_label_, fonts_.icon_font, 0);
|
||||
lv_obj_set_style_text_color(battery_label_, current_theme.text, 0);
|
||||
|
||||
// 创建emotion_label_在状态栏最右侧
|
||||
emotion_label_ = lv_label_create(status_bar_);
|
||||
lv_obj_set_style_text_font(emotion_label_, &font_awesome_30_4, 0);
|
||||
lv_obj_set_style_text_color(emotion_label_, current_theme.text, 0);
|
||||
lv_label_set_text(emotion_label_, FONT_AWESOME_AI_CHIP);
|
||||
lv_obj_set_style_margin_left(emotion_label_, 5, 0); // 添加左边距,与前面的元素分隔
|
||||
lv_obj_set_style_margin_left(battery_label_, 5, 0); // 添加左边距,与前面的元素分隔
|
||||
|
||||
low_battery_popup_ = lv_obj_create(screen);
|
||||
lv_obj_set_scrollbar_mode(low_battery_popup_, LV_SCROLLBAR_MODE_OFF);
|
||||
@@ -460,7 +464,7 @@ void LcdDisplay::SetChatMessage(const char* role, const char* content) {
|
||||
lv_obj_set_height(msg_bubble, LV_SIZE_CONTENT);
|
||||
|
||||
// Add some margin
|
||||
lv_obj_set_style_margin_left(msg_bubble, 0, 0);
|
||||
lv_obj_set_style_margin_left(msg_bubble, -4, 0);
|
||||
|
||||
// Don't grow
|
||||
lv_obj_set_style_flex_grow(msg_bubble, 0, 0);
|
||||
|
||||
Reference in New Issue
Block a user