| 16 | namespace tt::app::chat { |
| 17 | |
| 18 | void ChatView::addMessageToList(lv_obj_t* list, const StoredMessage& msg) { |
| 19 | auto* label = lv_label_create(list); |
| 20 | lv_label_set_text(label, msg.displayText.c_str()); |
| 21 | lv_obj_set_width(label, lv_pct(100)); |
| 22 | lv_label_set_long_mode(label, LV_LABEL_LONG_WRAP); |
| 23 | lv_obj_set_style_text_align(label, LV_TEXT_ALIGN_LEFT, 0); |
| 24 | lv_obj_set_style_pad_all(label, 2, 0); |
| 25 | |
| 26 | if (msg.isOwn) { |
| 27 | if (lv_display_get_color_format(lv_obj_get_display(label)) != LV_COLOR_FORMAT_L8) { |
| 28 | lv_obj_set_style_text_color(label, lv_color_hex(0x80C0FF), 0); |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | void ChatView::updateToolbarTitle() { |
| 34 | if (!state || !toolbar) return; |
nothing calls this directly
no outgoing calls
no test coverage detected