Issue about DropdownList with arrow and align_right

Description

When setting dropdownlist with arrow and option’s align_right,
the dropdownlist’s label is overlapped by arrow.
(as picture below )

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

  • ESP32
  • lvgl 6.0.2 master

What do you experience?

When setting padding’s right , but can’t solve this issue.

What do you expect?

The dropdownlist’s label doesn’t be overlapped by arrow or by scrollbar.

Code to reproduce


  lv_obj_t * ddlist = lv_ddlist_create(lv_scr_act(), NULL);
  lv_ddlist_set_options(ddlist, "Apple\n"
                                "Banana\n"
                                "Orange\n"
                                "Melon\n"
                                "Grape\n"
                                "Raspberry");

  lv_ddlist_set_fix_width(ddlist, 150);
  lv_ddlist_set_fix_height(ddlist, 200);
  lv_ddlist_set_draw_arrow(ddlist, true);
  lv_ddlist_set_align(ddlist, LV_LABEL_ALIGN_RIGHT);

Screenshot and/or video

image

This is a limitation of the arrow code (I don’t think it considers justification when determining position).

One solution would be to automatically move the arrow to the left if right justification is desired.

Good idea.

As a workaround, you can set body.padding.right to a larger value in LV_DDLIST_STYLE_BG.

read. some tip.

@ttxs1002004 Did part of your post not get sent? What you’ve currently written makes no sense to me.

I added this feature to dev-6.1. Now the arrow will move itself to the left if right alignment is used.

You can try it by pulling the dev-6.1 branch.

2 Likes

Awesome, thank you!