| 177 | } |
| 178 | |
| 179 | void View::init(lv_obj_t* parent, Mode mode) { |
| 180 | lv_obj_set_flex_flow(parent, LV_FLEX_FLOW_COLUMN); |
| 181 | lv_obj_set_style_pad_row(parent, 0, LV_STATE_DEFAULT); |
| 182 | |
| 183 | auto* toolbar = lvgl::toolbar_create(parent, "Select File"); |
| 184 | navigate_up_button = lvgl::toolbar_add_image_button_action(toolbar, LV_SYMBOL_UP, &onNavigateUpPressedCallback, this); |
| 185 | |
| 186 | auto* wrapper = lv_obj_create(parent); |
| 187 | lv_obj_set_width(wrapper, LV_PCT(100)); |
| 188 | lv_obj_set_style_border_width(wrapper, 0, 0); |
| 189 | lv_obj_set_style_pad_all(wrapper, 0, 0); |
| 190 | lv_obj_set_flex_grow(wrapper, 1); |
| 191 | lv_obj_set_flex_flow(wrapper, LV_FLEX_FLOW_ROW); |
| 192 | |
| 193 | dir_entry_list = lv_list_create(wrapper); |
| 194 | lv_obj_set_height(dir_entry_list, LV_PCT(100)); |
| 195 | lv_obj_set_flex_grow(dir_entry_list, 1); |
| 196 | |
| 197 | auto* bottom_wrapper = lv_obj_create(parent); |
| 198 | lv_obj_set_flex_flow(bottom_wrapper, LV_FLEX_FLOW_ROW); |
| 199 | lv_obj_set_size(bottom_wrapper, LV_PCT(100), LV_SIZE_CONTENT); |
| 200 | lv_obj_set_style_border_width(bottom_wrapper, 0, 0); |
| 201 | lv_obj_set_style_pad_all(bottom_wrapper, 0, 0); |
| 202 | |
| 203 | path_textarea = lv_textarea_create(bottom_wrapper); |
| 204 | lv_textarea_set_one_line(path_textarea, true); |
| 205 | lv_obj_set_flex_grow(path_textarea, 1); |
| 206 | lv_obj_add_event_cb(path_textarea, onPathTextChanged, LV_EVENT_VALUE_CHANGED, this); |
| 207 | |
| 208 | select_button = lv_button_create(bottom_wrapper); |
| 209 | auto* select_button_label = lv_label_create(select_button); |
| 210 | lv_label_set_text(select_button_label, "Select"); |
| 211 | lv_obj_add_event_cb(select_button, onSelectButtonPressed, LV_EVENT_SHORT_CLICKED, this); |
| 212 | lv_obj_add_flag(select_button, LV_OBJ_FLAG_HIDDEN); |
| 213 | |
| 214 | update(); |
| 215 | } |
| 216 | |
| 217 | } |
no test coverage detected