| 145 | } |
| 146 | |
| 147 | void ChatView::init(AppContext& appContext, lv_obj_t* parent) { |
| 148 | lv_obj_set_flex_flow(parent, LV_FLEX_FLOW_COLUMN); |
| 149 | lv_obj_set_style_pad_row(parent, 0, LV_STATE_DEFAULT); |
| 150 | |
| 151 | toolbar = lvgl::toolbar_create(parent, appContext); |
| 152 | lvgl::toolbar_add_text_button_action(toolbar, LV_SYMBOL_LIST, onChannelClicked, this); |
| 153 | lvgl::toolbar_add_text_button_action(toolbar, LV_SYMBOL_SETTINGS, onSettingsClicked, this); |
| 154 | updateToolbarTitle(); |
| 155 | |
| 156 | // Message list |
| 157 | msgList = lv_list_create(parent); |
| 158 | lv_obj_set_flex_grow(msgList, 1); |
| 159 | lv_obj_set_width(msgList, LV_PCT(100)); |
| 160 | if (lv_display_get_color_format(lv_obj_get_display(parent)) != LV_COLOR_FORMAT_L8) { |
| 161 | lv_obj_set_style_bg_color(msgList, lv_color_hex(0x262626), 0); |
| 162 | } |
| 163 | lv_obj_set_style_border_width(msgList, 0, 0); |
| 164 | lv_obj_set_style_pad_ver(msgList, 2, 0); |
| 165 | lv_obj_set_style_pad_hor(msgList, 4, 0); |
| 166 | |
| 167 | // Input bar |
| 168 | createInputBar(parent); |
| 169 | |
| 170 | // Overlay panels (hidden by default) |
| 171 | createSettingsPanel(parent); |
| 172 | createChannelPanel(parent); |
| 173 | } |
| 174 | |
| 175 | void ChatView::displayMessage(const StoredMessage& msg) { |
| 176 | if (!msgList || !state) return; |
no test coverage detected