popup: fix object_mirrored_set didn't work 24/132324/2
authorJinYong Park <j4939.park@samsung.com>
Fri, 2 Jun 2017 08:29:58 +0000 (17:29 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Wed, 7 Jun 2017 05:15:17 +0000 (05:15 +0000)
Using config_mirrored_set was working good at popup widget,
but object_mirrored_set didn't.
The mirrored value of notify, main layout, scroller, action area layout should be changed following popup.

@fix

https://phab.enlightenment.org/D4900

Change-Id: I5096e14c86ae313e10f2547e43b6e81de97690c3
Signed-off-by: Jinyong Park <j4939.park@samsung.com>
src/lib/elc_popup.c

index 7e3f86e..9c3f30e 100644 (file)
@@ -386,6 +386,17 @@ _mirrored_set(Evas_Object *obj,
    ELM_POPUP_DATA_GET(obj, sd);
 
    elm_object_mirrored_set(sd->notify, rtl);
+   elm_object_mirrored_set(sd->main_layout, rtl);
+   if (sd->scr) elm_object_mirrored_set(sd->scr, rtl);
+   if (sd->action_area) elm_object_mirrored_set(sd->action_area, rtl);
+   if (sd->items)
+     {
+        Elm_Popup_Item_Data *it;
+        Eina_List *l;
+
+        EINA_LIST_FOREACH(sd->items, l, it)
+          elm_object_mirrored_set(VIEW(it), rtl);
+     }
 }
 
 //TIZEN ONLY(20150717): expose title as at-spi object
@@ -1028,6 +1039,8 @@ _create_scroller(Evas_Object *obj)
    elm_scroller_bounce_set(sd->scr, EINA_FALSE, EINA_TRUE);
    evas_object_event_callback_add(sd->scr, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
                                   _size_hints_changed_cb, obj);
+   elm_widget_mirrored_automatic_set(sd->scr, EINA_FALSE);
+   elm_object_mirrored_set(sd->scr, elm_object_mirrored_get(obj));
    elm_table_pack(sd->tbl, sd->scr, 0, 0, 1, 1);
    evas_object_show(sd->scr);
 }
@@ -1279,6 +1292,8 @@ _item_new(Elm_Popup_Item_Data *it)
 
    VIEW(it) = elm_layout_add(WIDGET(it));
    elm_object_focus_allow_set(VIEW(it), EINA_TRUE);
+   elm_widget_mirrored_automatic_set(VIEW(it), EINA_FALSE);
+   elm_object_mirrored_set(VIEW(it), elm_object_mirrored_get(WIDGET(it)));
 
    snprintf(style, sizeof(style), "popup/%s", elm_widget_style_get(WIDGET(it)));
    if (!elm_layout_theme_set(VIEW(it), "popup", "item", style))
@@ -1638,6 +1653,8 @@ _action_button_set(Evas_Object *obj,
         evas_object_event_callback_add
           (sd->action_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
            _size_hints_changed_cb, sd->main_layout);
+        elm_widget_mirrored_automatic_set(sd->main_layout, EINA_FALSE);
+        elm_object_mirrored_set(sd->action_area, elm_object_mirrored_get(obj));
         eo_do(sd->main_layout, elm_obj_container_content_set
           ("elm.swallow.action_area", sd->action_area));
 
@@ -2084,6 +2101,8 @@ _elm_popup_evas_object_smart_add(Eo *obj, Elm_Popup_Data *priv)
    evas_object_size_hint_align_set
      (priv->notify, EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_smart_member_add(priv->notify, obj);
+   elm_widget_mirrored_automatic_set(priv->notify, EINA_FALSE);
+   elm_object_mirrored_set(priv->notify, elm_object_mirrored_get(obj));
 
    evas_object_event_callback_add(priv->notify, EVAS_CALLBACK_RESIZE, _notify_resize_cb, obj);
 
@@ -2098,6 +2117,8 @@ _elm_popup_evas_object_smart_add(Eo *obj, Elm_Popup_Data *priv)
    elm_object_content_set(priv->notify, priv->main_layout);
 
    evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _on_show, NULL);
+   elm_widget_mirrored_automatic_set(priv->main_layout, EINA_FALSE);
+   elm_object_mirrored_set(priv->main_layout, elm_object_mirrored_get(obj));
 
    elm_layout_signal_callback_add
      (priv->main_layout, "elm,state,title_area,visible", "elm", _layout_change_cb, NULL);