MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / addMessageToList

Method addMessageToList

Tactility/Source/app/chat/ChatView.cpp:18–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16namespace tt::app::chat {
17
18void 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
33void ChatView::updateToolbarTitle() {
34 if (!state || !toolbar) return;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected