Merge 5d91c24723 into dev
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
- Theme update to support text selection background
|
- Theme update to support text selection background
|
||||||
- Fix imgbtn state change
|
- Fix imgbtn state change
|
||||||
- Support RTL in table (draw columns right to left)
|
- Support RTL in table (draw columns right to left)
|
||||||
|
- Support RTL in pretty layout (draw columns right to left)
|
||||||
|
|
||||||
## v7.6.1 (06.10.2020)
|
## v7.6.1 (06.10.2020)
|
||||||
|
|
||||||
|
|||||||
@@ -566,25 +566,34 @@ static void lv_cont_layout_pretty(lv_obj_t * cont)
|
|||||||
lv_coord_t new_pinner = (w_obj - w_row) / (obj_num - 1);
|
lv_coord_t new_pinner = (w_obj - w_row) / (obj_num - 1);
|
||||||
lv_coord_t act_x = pleft; /*x init*/
|
lv_coord_t act_x = pleft; /*x init*/
|
||||||
child_tmp = child_rs;
|
child_tmp = child_rs;
|
||||||
|
lv_align_t align;
|
||||||
|
int32_t inv;
|
||||||
|
if(lv_obj_get_base_dir(cont) == LV_BIDI_DIR_RTL) {
|
||||||
|
align = LV_ALIGN_IN_TOP_RIGHT;
|
||||||
|
inv = -1;
|
||||||
|
} else {
|
||||||
|
align = LV_ALIGN_IN_TOP_LEFT;
|
||||||
|
inv = 1;
|
||||||
|
}
|
||||||
while(child_tmp != NULL) {
|
while(child_tmp != NULL) {
|
||||||
if(lv_obj_get_hidden(child_tmp) == false && lv_obj_is_protected(child_tmp, LV_PROTECT_POS) == false) {
|
if(lv_obj_get_hidden(child_tmp) == false && lv_obj_is_protected(child_tmp, LV_PROTECT_POS) == false) {
|
||||||
lv_coord_t mleft = lv_obj_get_style_margin_left(child_tmp, LV_OBJ_PART_MAIN);
|
lv_coord_t mleft = lv_obj_get_style_margin_left(child_tmp, LV_OBJ_PART_MAIN);
|
||||||
lv_coord_t mright = lv_obj_get_style_margin_right(child_tmp, LV_OBJ_PART_MAIN);
|
lv_coord_t mright = lv_obj_get_style_margin_right(child_tmp, LV_OBJ_PART_MAIN);
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case LV_LAYOUT_PRETTY_TOP:
|
case LV_LAYOUT_PRETTY_TOP:
|
||||||
lv_obj_align(child_tmp, cont, LV_ALIGN_IN_TOP_LEFT,
|
lv_obj_align(child_tmp, cont, align,
|
||||||
act_x + mleft,
|
inv * (act_x + mleft),
|
||||||
act_y + lv_obj_get_style_margin_top(child_tmp, LV_OBJ_PART_MAIN));
|
act_y + lv_obj_get_style_margin_top(child_tmp, LV_OBJ_PART_MAIN));
|
||||||
break;
|
break;
|
||||||
case LV_LAYOUT_PRETTY_MID:
|
case LV_LAYOUT_PRETTY_MID:
|
||||||
lv_obj_align(child_tmp, cont, LV_ALIGN_IN_TOP_LEFT,
|
lv_obj_align(child_tmp, cont, align,
|
||||||
act_x + mleft,
|
inv * (act_x + mleft),
|
||||||
act_y + (h_row - lv_obj_get_height(child_tmp)) / 2);
|
act_y + (h_row - lv_obj_get_height(child_tmp)) / 2);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case LV_LAYOUT_PRETTY_BOTTOM:
|
case LV_LAYOUT_PRETTY_BOTTOM:
|
||||||
lv_obj_align(child_tmp, cont, LV_ALIGN_IN_TOP_LEFT,
|
lv_obj_align(child_tmp, cont, align,
|
||||||
act_x + mleft,
|
inv * (act_x + mleft),
|
||||||
act_y + h_row - lv_obj_get_height(child_tmp) - lv_obj_get_style_margin_bottom(child_tmp, LV_OBJ_PART_MAIN));
|
act_y + h_row - lv_obj_get_height(child_tmp) - lv_obj_get_style_margin_bottom(child_tmp, LV_OBJ_PART_MAIN));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user