| 214 | // endregion Secondary updates |
| 215 | |
| 216 | void View::init(const AppContext& app, lv_obj_t* parent) { |
| 217 | lv_obj_set_flex_flow(parent, LV_FLEX_FLOW_COLUMN); |
| 218 | lv_obj_set_style_pad_row(parent, 0, LV_STATE_DEFAULT); |
| 219 | |
| 220 | root = parent; |
| 221 | paths = app.getPaths(); |
| 222 | |
| 223 | // Toolbar |
| 224 | auto* toolbar = lvgl::toolbar_create(parent, app); |
| 225 | |
| 226 | scanning_spinner = lvgl::toolbar_add_spinner_action(toolbar); |
| 227 | |
| 228 | enable_switch = lvgl::toolbar_add_switch_action(toolbar); |
| 229 | lv_obj_add_event_cb(enable_switch, onEnableSwitchChanged, LV_EVENT_VALUE_CHANGED, nullptr); |
| 230 | |
| 231 | // Peer list |
| 232 | peers_list = lv_list_create(parent); |
| 233 | lv_obj_set_flex_grow(peers_list, 1); |
| 234 | lv_obj_set_width(peers_list, LV_PCT(100)); |
| 235 | } |
| 236 | |
| 237 | void View::update() { |
| 238 | updateBtToggle(); |
no test coverage detected