components/core2forAWS/tft/lvgl/lvgl/src/lv_widgets/lv_cont.c
static void lv_cont_layout_grid(lv_obj_t * cont)
{
    lv_coord_t w_fit         =  lv_obj_get_width_fit(cont);
    lv_coord_t inner = lv_obj_get_style_pad_inner(cont, LV_CONT_PART_MAIN);
    lv_coord_t y_ofs = inner + lv_obj_get_height(lv_obj_get_child(cont, NULL));

    /* Disable child change action because the children will be moved a lot
     * an unnecessary child change signals could be sent*/
    lv_obj_add_protect(cont, LV_PROTECT_CHILD_CHG);

    /* Align the children */
    lv_coord_t left = lv_obj_get_style_pad_left(cont, LV_CONT_PART_MAIN);
    lv_coord_t act_x = left;
    lv_coord_t act_y = lv_obj_get_style_pad_top(cont, LV_CONT_PART_MAIN);
    lv_obj_t * child;
    _LV_LL_READ_BACK(cont->child_ll, child) {
        if(lv_obj_get_hidden(child) != false || lv_obj_is_protected(child, LV_PROTECT_POS) != false) continue;
        lv_coord_t obj_w = lv_obj_get_width(child);
        if(act_x + obj_w > w_fit + left) {
            act_x = left;
            act_y += y_ofs;
        }

        lv_obj_set_pos(child, act_x, act_y);
        act_x += inner + obj_w;
    }

    lv_obj_clear_protect(cont, LV_PROTECT_CHILD_CHG);
}
/**
 * Handle the grid layout. Align same-sized objects in a grid
 * @param cont pointer to an object which layout should be handled
 */
Handle the grid layout. Align same-sized objects in a grid
@param cont pointer to an object which layout should be handled
Handle the grid layout . Align same - sized objects in a grid @param cont pointer to an object which layout should be handled
static void lv_cont_layout_grid(lv_obj_t * cont)
{
    lv_coord_t w_fit         =  lv_obj_get_width_fit(cont);
    lv_coord_t inner = lv_obj_get_style_pad_inner(cont, LV_CONT_PART_MAIN);
    lv_coord_t y_ofs = inner + lv_obj_get_height(lv_obj_get_child(cont, NULL));
    lv_obj_add_protect(cont, LV_PROTECT_CHILD_CHG);
    lv_coord_t left = lv_obj_get_style_pad_left(cont, LV_CONT_PART_MAIN);
    lv_coord_t act_x = left;
    lv_coord_t act_y = lv_obj_get_style_pad_top(cont, LV_CONT_PART_MAIN);
    lv_obj_t * child;
    _LV_LL_READ_BACK(cont->child_ll, child) {
        if(lv_obj_get_hidden(child) != false || lv_obj_is_protected(child, LV_PROTECT_POS) != false) continue;
        lv_coord_t obj_w = lv_obj_get_width(child);
        if(act_x + obj_w > w_fit + left) {
            act_x = left;
            act_y += y_ofs;
        }
        lv_obj_set_pos(child, act_x, act_y);
        act_x += inner + obj_w;
    }
    lv_obj_clear_protect(cont, LV_PROTECT_CHILD_CHG);
}
static void lv_cont_layout_grid ( lv_obj_t * cont ) { lv_coord_t w_fit = lv_obj_get_width_fit ( cont ) ; lv_coord_t inner = lv_obj_get_style_pad_inner ( cont , LV_CONT_PART_MAIN ) ; lv_coord_t y_ofs = inner + lv_obj_get_height ( lv_obj_get_child ( cont , NULL ) ) ; lv_obj_add_protect ( cont , LV_PROTECT_CHILD_CHG ) ; lv_coord_t left = lv_obj_get_style_pad_left ( cont , LV_CONT_PART_MAIN ) ; lv_coord_t act_x = left ; lv_coord_t act_y = lv_obj_get_style_pad_top ( cont , LV_CONT_PART_MAIN ) ; lv_obj_t * child ; _LV_LL_READ_BACK ( cont -> child_ll , child ) { if ( lv_obj_get_hidden ( child ) != false || lv_obj_is_protected ( child , LV_PROTECT_POS ) != false ) continue ; lv_coord_t obj_w = lv_obj_get_width ( child ) ; if ( act_x + obj_w > w_fit + left ) { act_x = left ; act_y += y_ofs ; } lv_obj_set_pos ( child , act_x , act_y ) ; act_x += inner + obj_w ; } lv_obj_clear_protect ( cont , LV_PROTECT_CHILD_CHG ) ; }
Handle the grid layout.
Handle the grid layout .
/* Disable child change action because the children will be moved a lot
     * an unnecessary child change signals could be sent*/ /* Align the children */