widget: Inherit paragraph direction from widget parent
authorYoungbok Shin <youngb.shin@samsung.com>
Thu, 17 Nov 2016 05:39:47 +0000 (14:39 +0900)
committerJinYong Park <j4939.park@samsung.com>
Tue, 22 Nov 2016 10:46:57 +0000 (19:46 +0900)
A widget inherited paragraph direction from widget parent
when only the widget was added to widget parent as parent's sub object.
But, even if it is not sub object of parent,
its direcition should be initialized by parent's direction.

@tizen_fix

Change-Id: Id9d11ce3293d63b888c36e537229479c3a08284b

src/lib/elm_widget.c

index 938384b0daf4db313b98a69f2169be2319143b19..f5ee6c3e02e283e8830ff7f8ab84da20c75e5f7b 100644 (file)
@@ -1284,6 +1284,7 @@ _elm_widget_sub_object_add(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Object *sobj
           {
              sdc->paragraph_direction = evas_object_paragraph_direction_get(obj);
              _elm_widget_evas_object_paragraph_direction_set_internal(sobj, sdc, sdc->paragraph_direction);
+             eo_do_super(sobj, MY_CLASS, evas_obj_paragraph_direction_set(sdc->paragraph_direction));
           }
         /* END */
      }
@@ -1374,6 +1375,7 @@ _elm_widget_sub_object_del(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Object *sobj
           {
              sdc->paragraph_direction = EVAS_BIDI_DIRECTION_NEUTRAL;
              _elm_widget_evas_object_paragraph_direction_set_internal(sobj, sdc, sdc->paragraph_direction);
+             eo_do_super(sobj, MY_CLASS, evas_obj_paragraph_direction_set(EVAS_BIDI_DIRECTION_NEUTRAL));
           }
         /* END */
      }
@@ -6037,6 +6039,16 @@ _elm_widget_eo_base_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
    /* END */
 
    eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_UNKNOWN));
+
+   /* TIZEN_ONLY(20161117): Inherit paragraph direction from widget parent */
+   if (sd->paragraph_direction != evas_object_paragraph_direction_get(parent))
+     {
+        sd->paragraph_direction = evas_object_paragraph_direction_get(parent);
+        _elm_widget_evas_object_paragraph_direction_set_internal(obj, sd, sd->paragraph_direction);
+        eo_do_super(obj, MY_CLASS, evas_obj_paragraph_direction_set(sd->paragraph_direction));
+     }
+   /* END */
+
    return obj;
 }