combobox: Mark as legacy only if legacy API is used
authorJean-Philippe Andre <jp.andre@samsung.com>
Tue, 10 Oct 2017 05:15:21 +0000 (14:15 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 10 Oct 2017 09:44:35 +0000 (18:44 +0900)
See bc2fe6bb778b559e6c88f836d8cbdfb631b193b4

src/lib/elementary/elc_combobox.c

index 9372ffe..fde189a 100644 (file)
@@ -336,6 +336,15 @@ elm_combobox_add(Evas_Object *parent)
    return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
 }
 
+static inline void
+_hover_ctor(Eo *parent, Eo *hover)
+{
+   ELM_WIDGET_DATA_GET_OR_RETURN(parent, wd);
+   if (wd->legacy)
+     efl_canvas_object_legacy_ctor(hover);
+   efl_gfx_visible_set(hover, EINA_FALSE);
+}
+
 EOLIAN static Eo *
 _elm_combobox_efl_object_constructor(Eo *obj, Elm_Combobox_Data *sd)
 {
@@ -358,8 +367,8 @@ _elm_combobox_efl_object_constructor(Eo *obj, Elm_Combobox_Data *sd)
 
    //hover
    sd->hover = efl_add(ELM_HOVER_CLASS, sd->hover_parent,
-                       elm_obj_widget_style_set(efl_added, buf),
-                       efl_canvas_object_legacy_ctor(efl_added));
+                       _hover_ctor(obj, efl_added),
+                       elm_obj_widget_style_set(efl_added, buf));
    evas_object_layer_set(sd->hover, EVAS_LAYER_MAX);
    efl_ui_mirrored_automatic_set(sd->hover, EINA_FALSE);
    elm_hover_target_set(sd->hover, obj);