WiFi improvements (#102)

This commit is contained in:
Ken Van Hoeylandt
2024-12-03 22:22:45 +01:00
committed by GitHub
parent 505befef42
commit c7314546fe
27 changed files with 581 additions and 454 deletions
+8 -1
View File
@@ -103,7 +103,7 @@ void toolbar_set_nav_action(lv_obj_t* obj, const char* icon, lv_event_cb_t callb
lv_image_set_src(toolbar->close_button_image, icon); // e.g. LV_SYMBOL_CLOSE
}
uint8_t toolbar_add_action(lv_obj_t* obj, const char* icon, const char* text, lv_event_cb_t callback, void* user_data) {
uint8_t toolbar_add_action(lv_obj_t* obj, const char* icon, lv_event_cb_t callback, void* user_data) {
auto* toolbar = (Toolbar*)obj;
uint8_t id = toolbar->action_count;
tt_check(toolbar->action_count < TOOLBAR_ACTION_LIMIT, "max actions reached");
@@ -120,4 +120,11 @@ uint8_t toolbar_add_action(lv_obj_t* obj, const char* icon, const char* text, lv
return id;
}
lv_obj_t* toolbar_add_switch_action(lv_obj_t* obj) {
auto* toolbar = (Toolbar*)obj;
lv_obj_t* widget = lv_switch_create(toolbar->action_container);
lv_obj_set_pos(widget, 0, 4); // Because aligning doesn't work
return widget;
}
} // namespace