fix(bidi) fix tabview, textarea, label, btnmatrix, roller, dropdown with RTL base direction

This commit is contained in:
Gabor Kiss-Vamosi
2021-05-20 12:04:06 +02:00
parent a63ab1eef1
commit 1386edf2fb
15 changed files with 68 additions and 17 deletions

View File

@@ -11,7 +11,7 @@ void lv_example_flex_6(void)
lv_obj_set_style_base_dir(cont, LV_BASE_DIR_RTL, 0);
lv_obj_set_size(cont, 300, 220);
lv_obj_center(cont);
lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_ROW_WRAP);
lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_COLUMN_WRAP);
uint32_t i;
for(i = 0; i < 20; i++) {
@@ -23,4 +23,5 @@ void lv_example_flex_6(void)
lv_obj_center(label);
}
}
#endif

View File

@@ -19,6 +19,8 @@ static void sw_event_cb(lv_event_t * e)
*/
void lv_example_scroll_2(void)
{
lv_obj_set_style_base_dir(lv_scr_act(), LV_BASE_DIR_RTL, 0);
lv_obj_t * panel = lv_obj_create(lv_scr_act());
lv_obj_set_size(panel, 280, 150);
lv_obj_set_scroll_snap_x(panel, LV_SCROLL_SNAP_CENTER);
@@ -40,6 +42,7 @@ void lv_example_scroll_2(void)
lv_obj_center(label);
}
lv_obj_update_snap(panel, LV_ANIM_ON);
#if LV_USE_SWITCH

View File

@@ -3,6 +3,7 @@
void lv_example_tabview_1(void)
{
lv_obj_set_style_base_dir(lv_scr_act(), LV_BASE_DIR_RTL, 0);
/*Create a Tab view object*/
lv_obj_t *tabview;
tabview = lv_tabview_create(lv_scr_act(), LV_DIR_TOP, 50);
@@ -36,7 +37,7 @@ void lv_example_tabview_1(void)
label = lv_label_create(tab3);
lv_label_set_text(label, "Third tab");
lv_obj_scroll_to_view_recursive(label, LV_ANIM_ON);
// lv_obj_scroll_to_view_recursive(label, LV_ANIM_ON);
}
#endif

View File

@@ -21,8 +21,10 @@ static void btnm_event_handler(lv_event_t * e)
void lv_example_textarea_1(void)
{
// lv_obj_set_style_base_dir(lv_scr_act(), LV_BASE_DIR_RTL, 0);
lv_obj_t * ta = lv_textarea_create(lv_scr_act());
lv_textarea_set_one_line(ta, true);
// lv_textarea_set_one_line(ta, true);
lv_textarea_set_text(ta, "Hey");
lv_obj_align(ta, LV_ALIGN_TOP_MID, 0, 10);
lv_obj_add_event_cb(ta, textarea_event_handler, LV_EVENT_READY, ta);
lv_obj_add_state(ta, LV_STATE_FOCUSED); /*To be sure the cursor is visible*/

View File

@@ -7,6 +7,7 @@ static lv_obj_t * kb;
void lv_example_textarea_2(void)
{
lv_obj_set_style_base_dir(lv_scr_act(), LV_BASE_DIR_RTL, 0);
/*Create the password box*/
lv_obj_t * pwd_ta = lv_textarea_create(lv_scr_act());
lv_textarea_set_text(pwd_ta, "");