show node on chat clicked (#117)

This commit is contained in:
Manuel
2025-04-12 21:12:06 +02:00
committed by GitHub
parent 13f69c5f8d
commit 3cdb8a6303
2 changed files with 15 additions and 0 deletions
@@ -369,6 +369,7 @@ class TFTView_320x240 : public MeshtasticView
static void ui_event_mapBrightnessSlider(lv_event_t *e);
static void ui_event_mapContrastSlider(lv_event_t *e);
static void ui_event_mapNodeButton(lv_event_t *e);
static void ui_event_chatNodeButton(lv_event_t *e);
static void ui_event_positionButton(lv_event_t *e);
// animations
+14
View File
@@ -2209,6 +2209,19 @@ void TFTView_320x240::ui_event_mapNodeButton(lv_event_t *e)
ui_event_NodeButton(e);
}
void TFTView_320x240::ui_event_chatNodeButton(lv_event_t *e)
{
uint32_t nodeNum = (unsigned long)e->user_data;
auto it = THIS->nodes.find(nodeNum);
if (it != THIS->nodes.end()) {
lv_obj_t *panel = it->second;
THIS->ui_set_active(objects.nodes_button, objects.nodes_panel, objects.top_nodes_panel);
lv_obj_scroll_to_view(panel, LV_ANIM_ON);
if (panel != currentPanel)
ui_event_NodeButton(e);
}
}
void TFTView_320x240::ui_event_positionButton(lv_event_t *e)
{
// navigate to position in map
@@ -6118,6 +6131,7 @@ void TFTView_320x240::newMessage(uint32_t nodeNum, lv_obj_t *container, uint8_t
lv_obj_scroll_to_view(hiddenPanel, LV_ANIM_ON);
lv_obj_move_foreground(objects.message_input_area);
lv_obj_add_event_cb(hiddenPanel, ui_event_chatNodeButton, LV_EVENT_CLICKED, (void *)nodeNum);
}
/**