How do I remove white space around the list widget?

Description

What MCU/Processor/Board and compiler are you using?

SDL stimulator

What LVGL version are you using?

v8.3

What do you want to achieve?

Remove white space around the list widget.
image
The red line is the border I added for the button, and the gray is the border for the list. I want there to be no white space between the red and gray. In other words, I want the text to be next to the left side of the list.

What have you tried so far?

  1. Sets the padding of the list.
lv_obj_set_style_pad_hor(list, 0, 0);
  1. Set the margin of the button.
lv_obj_t *btn = lv_list_add_btn(list, NULL, text_left[i]);
lv_obj_align(btn, LV_ALIGN_RIGHT_MID, 0, 0);
  1. Listening LV_EVENT_DRAW_PART_BEGIN event
    But the list does not have an items component.

Code to reproduce

void list_draw(lv_obj_draw_part_dsc_t *dsc) {
    dsc->rect_dsc->radius = 0;
    // dsc->rect_dsc->border_width = 2;
    // dsc->rect_dsc->border_color = lv_color_hex(0x39C5BB);
    // dsc->rect_dsc->bg_color = lv_color_hex(0x3906);
    
}

void list_draw_style_handler(lv_event_t *e) {
    lv_obj_t *widget = lv_event_get_target(e);
    lv_obj_draw_part_dsc_t *dsc = lv_event_get_param(e);
    Style *style = lv_event_get_user_data(e);

    if (dsc != NULL && dsc->part == LV_PART_MAIN){
        list_draw(dsc);
    }

    // if (dsc != NULL && dsc->part == LV_PART_ITEMS){
    //     printf("ddd\n");
    // }
}

lv_obj_t* add_list() {
    lv_obj_t* list;

    list = lv_list_create(lv_scr_act());

    // Overall style
    lv_obj_set_x(list, 30);
    lv_obj_set_y(list, 10);
    lv_obj_set_width(list, 257);
    lv_obj_set_height(list, 195);

    // Redraw events and fine-grained style adjustments
    lv_obj_add_event_cb(list, list_draw_style_handler, LV_EVENT_DRAW_PART_BEGIN);

    return list;
}

// Dynamically generate list items
void set_list_text(lv_obj_t *widget, char** text_left, char** text_right, int item_num) {

    lv_obj_clean(widget);

    for (int i = 0; i < item_num; i++)
    {
        lv_obj_t *btn = lv_list_add_btn(widget, NULL, text_left[i]);
        lv_obj_t *label_left = lv_obj_get_child(btn, 0);
        lv_obj_t *label_right = lv_label_create(btn); 

        // List item style
        lv_obj_set_style_pad_top(btn, 0, 0);
        lv_obj_set_height(btn, 40);
        lv_obj_set_style_pad_left(btn, 0, 0);
        lv_obj_set_style_pad_right(btn, 0, 0);

        // Text style
        lv_obj_align(label_left, LV_ALIGN_LEFT_MID, 0, 0);
        lv_obj_align(label_right, LV_ALIGN_RIGHT_MID, 0, 0);
        lv_label_set_text(label_left, text_left[i]);
        lv_label_set_text(label_right, text_right[i]);  

        lv_obj_set_user_data(btn, i);
 
        lv_obj_set_style_outline_width(btn, 2, LV_STATE_USER_1);
        lv_obj_set_style_outline_color(btn, lv_color_hex(0xff0000), LV_STATE_USER_1);
        lv_obj_set_style_outline_pad(btn, 0, LV_STATE_USER_1);
        lv_obj_add_state(btn, LV_STATE_USER_1);
    }
}