dropdown list fixes with Bidi == RTL
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user