1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

dropdown list fixes with Bidi == RTL

This commit is contained in:
Gabor Kiss-Vamosi 2020-09-28 11:48:27 +02:00
parent 5be1fcadca
commit a24e3f619f
2 changed files with 11 additions and 2 deletions

View File

@ -9,6 +9,7 @@
- Fix selection of options with non-ASCII letters in dropdown list
- Fix font loader to support LV_FONT_FMT_TXT_LARGE
- Fix BIDI support in dropdown list
- Fix copying base dir in lv_obj_craete
## v7.5.0 (15.09.2020)

View File

@ -677,6 +677,10 @@ void lv_dropdown_open(lv_obj_t * ddlist)
lv_obj_set_y(ext->page, lv_obj_get_y(ext->page) - (ext->page->coords.y2 - LV_VER_RES));
}
}
if(lv_label_get_align(label) == LV_LABEL_ALIGN_RIGHT) {
lv_obj_set_x(label, lv_obj_get_width_fit(ext->page) - lv_obj_get_width(label));
}
}
/**
@ -739,7 +743,11 @@ static lv_design_res_t lv_dropdown_design(lv_obj_t * ddlist, const lv_area_t * c
const char * txt;
txt = ext->dir != LV_DROPDOWN_DIR_LEFT ? opt_txt : ext->symbol;
bool rev = false;
if(ext->dir == LV_DROPDOWN_DIR_LEFT) rev = true;
if(lv_obj_get_base_dir(ddlist) == LV_BIDI_DIR_RTL) rev = true;
txt = rev ? ext->symbol : opt_txt;
if(txt) {
_lv_txt_get_size(&txt_size, txt, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX,
label_dsc.flag);
@ -759,7 +767,7 @@ static lv_design_res_t lv_dropdown_design(lv_obj_t * ddlist, const lv_area_t * c
lv_draw_label(&txt_area, clip_area, &label_dsc, txt, NULL);
}
txt = ext->dir != LV_DROPDOWN_DIR_LEFT ? ext->symbol : opt_txt;
txt =rev ? opt_txt : ext->symbol;
if(txt) {
_lv_txt_get_size(&txt_size, txt, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX,
label_dsc.flag);