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

Method createBottomButtons

Tactility/Source/app/wificonnect/View.cpp:83–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83void 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
112void View::init(AppContext& app, lv_obj_t* parent) {

Callers

nothing calls this directly

Calls 1

spinner_createFunction · 0.85

Tested by

no test coverage detected