| 81 | } |
| 82 | |
| 83 | void View::createBottomButtons(lv_obj_t* parent) { |
| 84 | auto* button_container = lv_obj_create(parent); |
| 85 | lv_obj_set_width(button_container, LV_PCT(100)); |
| 86 | lv_obj_set_height(button_container, LV_SIZE_CONTENT); |
| 87 | lv_obj_set_style_pad_all(button_container, 0, LV_STATE_DEFAULT); |
| 88 | lv_obj_set_style_pad_gap(button_container, 0, LV_STATE_DEFAULT); |
| 89 | lv_obj_set_style_border_width(button_container, 0, LV_STATE_DEFAULT); |
| 90 | |
| 91 | remember_switch = lv_switch_create(button_container); |
| 92 | lv_obj_add_state(remember_switch, LV_STATE_CHECKED); |
| 93 | lv_obj_align(remember_switch, LV_ALIGN_LEFT_MID, 0, 0); |
| 94 | |
| 95 | auto* remember_label = lv_label_create(button_container); |
| 96 | lv_label_set_text(remember_label, "Remember"); |
| 97 | lv_obj_align(remember_label, LV_ALIGN_CENTER, 0, 0); |
| 98 | lv_obj_align_to(remember_label, remember_switch, LV_ALIGN_OUT_RIGHT_MID, 4, 0); |
| 99 | |
| 100 | connecting_spinner = tt::lvgl::spinner_create(button_container); |
| 101 | lv_obj_align(connecting_spinner, LV_ALIGN_RIGHT_MID, 0, 0); |
| 102 | lv_obj_add_flag(connecting_spinner, LV_OBJ_FLAG_HIDDEN); |
| 103 | |
| 104 | connect_button = lv_btn_create(button_container); |
| 105 | auto* connect_label = lv_label_create(connect_button); |
| 106 | lv_label_set_text(connect_label, "Connect"); |
| 107 | lv_obj_align(connect_button, LV_ALIGN_RIGHT_MID, 0, 0); |
| 108 | lv_obj_add_event_cb(connect_button, &onConnect, LV_EVENT_SHORT_CLICKED, nullptr); |
| 109 | } |
| 110 | |
| 111 | // TODO: Standardize dialogs |
| 112 | void View::init(AppContext& app, lv_obj_t* parent) { |
nothing calls this directly
no test coverage detected