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

Function create_action_wrapper

Tactility/Source/lvgl/Toolbar.cpp:41–55  ·  view source on GitHub ↗

* Helps with button expansion and also with vertical alignment of content, * as the parent flex doesn't allow for vertical alignment */

Source from the content-addressed store, hash-verified

39 * as the parent flex doesn't allow for vertical alignment
40 */
41static lv_obj_t* create_action_wrapper(lv_obj_t* parent, UiDensity ui_density) {
42 auto* wrapper = lv_obj_create(parent);
43 auto toolbar_height = getToolbarHeight(ui_density);
44 lv_obj_set_size(wrapper, LV_SIZE_CONTENT, toolbar_height);
45
46 auto icon_padding = getActionIconPadding(ui_density);
47 auto icon_padding_half = icon_padding / 2;
48
49 lv_obj_set_style_pad_all(wrapper, icon_padding_half, LV_STATE_DEFAULT); // For selection and touch animation
50 lv_obj_set_style_bg_opa(wrapper, 0, LV_STATE_DEFAULT);
51 lv_obj_set_style_border_width(wrapper, 0, LV_STATE_DEFAULT);
52 lv_obj_set_style_border_opa(wrapper, 0, LV_STATE_DEFAULT);
53
54 return wrapper;
55}
56
57typedef struct {
58 lv_obj_t obj;

Callers 4

toolbar_createFunction · 0.85

Calls 2

getToolbarHeightFunction · 0.85
getActionIconPaddingFunction · 0.85

Tested by

no test coverage detected