|
|
@@ -8,6 +8,7 @@
|
|
|
#include "assets/lang_config.h"
|
|
|
#include <cstring>
|
|
|
#include "settings.h"
|
|
|
+#include "command.h"
|
|
|
|
|
|
#include "board.h"
|
|
|
#include "esp_lcd_touch_gt911.h"
|
|
|
@@ -395,19 +396,28 @@ void LcdDisplay::SetupUI() {
|
|
|
// 替代方案:使用旧版本兼容方法固定元素位置
|
|
|
// 1. 创建一个固定在右下角的容器
|
|
|
lv_obj_t* fixed_container = lv_obj_create(screen);
|
|
|
- lv_obj_set_size(fixed_container, 40, 40); // 根据图标大小调整
|
|
|
+ lv_obj_set_size(fixed_container, 140, 140); // 根据图标大小调整
|
|
|
lv_obj_align(fixed_container, LV_ALIGN_BOTTOM_RIGHT, -10, -10);
|
|
|
lv_obj_set_style_bg_opa(fixed_container, LV_OPA_TRANSP, 0); // 透明背景
|
|
|
lv_obj_set_style_border_width(fixed_container, 0, 0); // 无边框
|
|
|
lv_obj_clear_flag(fixed_container, LV_OBJ_FLAG_SCROLLABLE); // 禁止滚动
|
|
|
|
|
|
// 2. 将图标添加到这个容器中
|
|
|
- emotion_label_1 = lv_label_create(fixed_container);
|
|
|
- lv_obj_set_style_text_font(emotion_label_1, &font_awesome_30_4, 0);
|
|
|
- lv_obj_set_style_text_color(emotion_label_1, current_theme.text, 0);
|
|
|
- lv_label_set_text(emotion_label_1, FONT_AWESOME_AI_CHIP);
|
|
|
- lv_obj_center(emotion_label_1); // 居中显示在容器中
|
|
|
- lv_obj_set_style_pad_row(content_, 10, 0); // Space between messages
|
|
|
+ // emotion_label_1 = lv_label_create(fixed_container);
|
|
|
+ // lv_obj_set_style_text_font(emotion_label_1, &font_awesome_30_4, 0);
|
|
|
+ // lv_obj_set_style_text_color(emotion_label_1, current_theme.text, 0);
|
|
|
+ // lv_label_set_text(emotion_label_1, FONT_AWESOME_AI_CHIP);
|
|
|
+ // lv_obj_center(emotion_label_1); // 居中显示在容器中
|
|
|
+ // lv_obj_set_style_pad_row(content_, 10, 0); // Space between messages
|
|
|
+
|
|
|
+ // 添加图片到容器中
|
|
|
+ lv_obj_t* image_obj = lv_img_create(fixed_container);
|
|
|
+ // 设置图片源,这里假设使用内置图片资源或已注册的图片
|
|
|
+ lv_img_set_src(image_obj, &command_img); // 示例:使用内置符号作为图片
|
|
|
+ // 或者使用自定义图片:lv_img_set_src(image_obj, &image_data);
|
|
|
+ lv_obj_align(image_obj, LV_ALIGN_BOTTOM_MID, 0, -5); // 居底部中间显示
|
|
|
+ // lv_obj_set_style_img_recolor_opa(image_obj, LV_OPA_70, 0); // 设置图片透明度
|
|
|
+ // lv_obj_set_style_img_recolor(image_obj, lv_color_hex(0xF8F8FF), 0); // 设置图片颜色
|
|
|
|
|
|
// We'll create chat messages dynamically in SetChatMessage
|
|
|
chat_message_label_ = nullptr;
|