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

Function createWidget

Tactility/Source/app/settings/Settings.cpp:20–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20static void createWidget(const std::shared_ptr<AppManifest>& manifest, void* parent) {
21 check(parent);
22 auto* list = static_cast<lv_obj_t*>(parent);
23 const void* icon = !manifest->appIcon.empty() ? manifest->appIcon.c_str() : LVGL_ICON_SHARED_TOOLBAR;
24 auto* btn = lv_list_add_button(list, icon, manifest->appName.c_str());
25 lv_obj_t* image = lv_obj_get_child(btn, 0);
26 lv_obj_set_style_text_font(image, lvgl_get_shared_icon_font(), LV_PART_MAIN);
27 lv_obj_add_event_cb(btn, &onAppPressed, LV_EVENT_SHORT_CLICKED, (void*)manifest.get());
28}
29
30class SettingsApp final : public App {
31

Callers 1

onShowMethod · 0.85

Calls 3

checkFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected