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

Method createChannelPanel

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

Source from the content-addressed store, hash-verified

110}
111
112void ChatView::createChannelPanel(lv_obj_t* parent) {
113 channelPanel = lv_obj_create(parent);
114 lv_obj_set_width(channelPanel, LV_PCT(100));
115 lv_obj_set_flex_grow(channelPanel, 1);
116 lv_obj_set_flex_flow(channelPanel, LV_FLEX_FLOW_COLUMN);
117 lv_obj_set_style_pad_all(channelPanel, 8, 0);
118 lv_obj_set_style_pad_row(channelPanel, 6, 0);
119 lv_obj_add_flag(channelPanel, LV_OBJ_FLAG_HIDDEN);
120
121 auto* label = lv_label_create(channelPanel);
122 lv_label_set_text(label, "Channel (e.g. #general):");
123
124 channelInput = lv_textarea_create(channelPanel);
125 lv_obj_set_width(channelInput, LV_PCT(100));
126 lv_textarea_set_one_line(channelInput, true);
127 lv_textarea_set_max_length(channelInput, MAX_TARGET_LEN);
128
129 auto* btnRow = lv_obj_create(channelPanel);
130 lv_obj_set_flex_flow(btnRow, LV_FLEX_FLOW_ROW);
131 lv_obj_set_size(btnRow, LV_PCT(100), LV_SIZE_CONTENT);
132 lv_obj_set_style_pad_all(btnRow, 0, 0);
133 lv_obj_set_style_pad_column(btnRow, 8, 0);
134 lv_obj_set_style_border_opa(btnRow, 0, 0);
135
136 auto* okBtn = lv_button_create(btnRow);
137 lv_obj_add_event_cb(okBtn, onChannelSave, LV_EVENT_CLICKED, this);
138 auto* okLbl = lv_label_create(okBtn);
139 lv_label_set_text(okLbl, "OK");
140
141 auto* cancelBtn = lv_button_create(btnRow);
142 lv_obj_add_event_cb(cancelBtn, onChannelCancel, LV_EVENT_CLICKED, this);
143 auto* cancelLbl = lv_label_create(cancelBtn);
144 lv_label_set_text(cancelLbl, "Cancel");
145}
146
147void ChatView::init(AppContext& appContext, lv_obj_t* parent) {
148 lv_obj_set_flex_flow(parent, LV_FLEX_FLOW_COLUMN);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected