mobile_lib/ctxpopup : enable elm_ctxpopup_item_content_unset 85/139085/3
authorJEONGHYUN YUN <jh0506.yun@samsung.com>
Mon, 17 Jul 2017 07:57:32 +0000 (16:57 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Wed, 19 Jul 2017 09:46:09 +0000 (09:46 +0000)
Change-Id: Id61addf2b57db6f3b2f4e2cf921c76b1f35092de
Signed-off-by: JEONGHYUN YUN <jh0506.yun@samsung.com>
src/mobile_lib/elc_ctxpopup.c

index 6b1628a1c2779c27f3d2224499307e982e68dc58..3edd8dbc201de3b7fc004f7225dc6e8b26706942 100644 (file)
@@ -1664,6 +1664,44 @@ _elm_ctxpopup_item_elm_widget_item_part_content_get(Eo *eo_ctxpopup_it EINA_UNUS
    return ctxpopup_it->icon;
 }
 
+EOLIAN static Evas_Object *
+_elm_ctxpopup_item_elm_widget_item_part_content_unset(Eo *eo_ctxpopup_it EINA_UNUSED,
+                                                      Elm_Ctxpopup_Item_Data *ctxpopup_it,
+                                                      const char *part)
+{
+   Evas_Object *content = NULL;
+
+   if (!ctxpopup_it || !ctxpopup_it->icon) return NULL;
+   if ((part) && (strcmp(part, "icon"))) return NULL;
+
+   ELM_CTXPOPUP_DATA_GET(WIDGET(ctxpopup_it), sd);
+
+   edje_object_part_unswallow(VIEW(ctxpopup_it), ctxpopup_it->icon);
+   evas_object_hide(ctxpopup_it->icon);
+
+   if (ctxpopup_it->label)
+     {
+        if (!sd->horizontal)
+          _elm_theme_object_set(WIDGET(ctxpopup_it), VIEW(ctxpopup_it), "ctxpopup",
+                                "text_style_item",
+                                elm_widget_style_get(WIDGET(ctxpopup_it)));
+        else
+          _elm_theme_object_set(WIDGET(ctxpopup_it), VIEW(ctxpopup_it), "ctxpopup",
+                                "text_style_item_horizontal",
+                                elm_widget_style_get(WIDGET(ctxpopup_it)));
+     }
+
+   content = ctxpopup_it->icon;
+   ctxpopup_it->icon = NULL;
+
+   sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
+
+   if (sd->visible)
+     elm_layout_sizing_eval(WIDGET(ctxpopup_it));
+
+   return content;
+}
+
 EOLIAN static void
 _elm_ctxpopup_item_elm_widget_item_disable(Eo *eo_ctxpopup_it,
                                            Elm_Ctxpopup_Item_Data *ctxpopup_it)