lvgl/src/lv_objx/lv_cont.c
/**
 * Handle row type layouts
 * @param cont pointer to an object which layout should be handled
 */
Handle row type layouts
@param cont pointer to an object which layout should be handled
Handle row type layouts @param cont pointer to an object which layout should be handled
static void lv_cont_layout_row(lv_obj_t * cont)
{
    lv_layout_t type = lv_cont_get_layout(cont);
    lv_obj_t * child;
    lv_align_t align;
    const lv_style_t * style = lv_obj_get_style(cont);
    lv_coord_t vpad_corr;
    lv_bidi_dir_t base_dir = lv_obj_get_base_dir(cont);
    switch(type) {
        case LV_LAYOUT_ROW_T:
            vpad_corr = style->body.padding.top;
            align     = base_dir == LV_BIDI_DIR_RTL ? LV_ALIGN_IN_TOP_RIGHT : LV_ALIGN_IN_TOP_LEFT;
            break;
        case LV_LAYOUT_ROW_M:
            vpad_corr = 0;
            align     = base_dir == LV_BIDI_DIR_RTL ? LV_ALIGN_IN_RIGHT_MID: LV_ALIGN_IN_LEFT_MID;
            break;
        case LV_LAYOUT_ROW_B:
            vpad_corr = -style->body.padding.bottom;
            align     = base_dir == LV_BIDI_DIR_RTL ? LV_ALIGN_IN_BOTTOM_RIGHT: LV_ALIGN_IN_BOTTOM_LEFT;
            break;
        default:
            vpad_corr = 0;
            align     = base_dir == LV_BIDI_DIR_RTL ? LV_ALIGN_IN_TOP_RIGHT : LV_ALIGN_IN_TOP_LEFT;
            break;
    }
    lv_obj_set_protect(cont, LV_PROTECT_CHILD_CHG);
    lv_coord_t last_cord;
    if(base_dir == LV_BIDI_DIR_RTL) last_cord = style->body.padding.right;
    else last_cord = style->body.padding.left;
    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;
        if(base_dir == LV_BIDI_DIR_RTL) lv_obj_align(child, cont, align, -last_cord, vpad_corr);
        else lv_obj_align(child, cont, align, last_cord, vpad_corr);
        last_cord += lv_obj_get_width(child) + style->body.padding.inner;
    }
    lv_obj_clear_protect(cont, LV_PROTECT_CHILD_CHG);
}
static void lv_cont_layout_row ( lv_obj_t * cont ) { lv_layout_t type = lv_cont_get_layout ( cont ) ; lv_obj_t * child ; lv_align_t align ; const lv_style_t * style = lv_obj_get_style ( cont ) ; lv_coord_t vpad_corr ; lv_bidi_dir_t base_dir = lv_obj_get_base_dir ( cont ) ; switch ( type ) { case LV_LAYOUT_ROW_T : vpad_corr = style -> body . padding . top ; align = base_dir == LV_BIDI_DIR_RTL ? LV_ALIGN_IN_TOP_RIGHT : LV_ALIGN_IN_TOP_LEFT ; break ; case LV_LAYOUT_ROW_M : vpad_corr = 0 ; align = base_dir == LV_BIDI_DIR_RTL ? LV_ALIGN_IN_RIGHT_MID : LV_ALIGN_IN_LEFT_MID ; break ; case LV_LAYOUT_ROW_B : vpad_corr = - style -> body . padding . bottom ; align = base_dir == LV_BIDI_DIR_RTL ? LV_ALIGN_IN_BOTTOM_RIGHT : LV_ALIGN_IN_BOTTOM_LEFT ; break ; default : vpad_corr = 0 ; align = base_dir == LV_BIDI_DIR_RTL ? LV_ALIGN_IN_TOP_RIGHT : LV_ALIGN_IN_TOP_LEFT ; break ; } lv_obj_set_protect ( cont , LV_PROTECT_CHILD_CHG ) ; lv_coord_t last_cord ; if ( base_dir == LV_BIDI_DIR_RTL ) last_cord = style -> body . padding . right ; else last_cord = style -> body . padding . left ; 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 ; if ( base_dir == LV_BIDI_DIR_RTL ) lv_obj_align ( child , cont , align , - last_cord , vpad_corr ) ; else lv_obj_align ( child , cont , align , last_cord , vpad_corr ) ; last_cord += lv_obj_get_width ( child ) + style -> body . padding . inner ; } lv_obj_clear_protect ( cont , LV_PROTECT_CHILD_CHG ) ; }
Handle row type layouts
 @param cont pointer to an object which layout should be handled
Handle row type layouts @param cont pointer to an object which layout should be handled
/*Adjust margin and get the alignment type*/ /* Disable child change action because the children will be moved a lot
     * an unnecessary child change signals could be sent*/ /* Align the children */ //        last_cord -= lv_obj_get_width(child);