summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSungtaek Hong <sth253.hong@samsung.com>2017-11-28 11:47:42 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-28 11:47:43 +0900
commit8193864d7d89adfc4585a5ce8432b765fabfb96c (patch)
tree2b2e70b73f7e36e3eed10418ee715f9176733529
parent8b0c8c2eb70daaca3b9a5cb544edf7aac5a30838 (diff)
elc_combobox: use elm_legacy_add for internal component
Summary: elm_combobox has entry, genlist, hover as its component. Those components should be marked as legacy during efl_add. Test Plan: Run elementary test. Run combobox test. Reviewers: jpeg, cedric, woohyun Differential Revision: https://phab.enlightenment.org/D5542
-rw-r--r--src/lib/elementary/elc_combobox.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/src/lib/elementary/elc_combobox.c b/src/lib/elementary/elc_combobox.c
index 54c6c20..81c33d3 100644
--- a/src/lib/elementary/elc_combobox.c
+++ b/src/lib/elementary/elc_combobox.c
@@ -288,6 +288,25 @@ _on_clicked(void *data, const Efl_Event *event EINA_UNUSED)
288 elm_combobox_hover_begin(data); 288 elm_combobox_hover_begin(data);
289} 289}
290 290
291static Eo *
292_elm_combobox_component_add(Eo *obj, Eo *parent, const Efl_Class *klass, char *style)
293{
294 Eo *component;
295
296 if (elm_widget_is_legacy(obj))
297 {
298 component = elm_legacy_add(klass, parent,
299 efl_ui_widget_style_set(efl_added, style));
300 }
301 else
302 {
303 component = efl_add(klass, parent,
304 efl_ui_widget_style_set(efl_added, style));
305 }
306
307 return component;
308}
309
291EOLIAN static void 310EOLIAN static void
292_elm_combobox_efl_canvas_group_group_add(Eo *obj, Elm_Combobox_Data *sd EINA_UNUSED) 311_elm_combobox_efl_canvas_group_group_add(Eo *obj, Elm_Combobox_Data *sd EINA_UNUSED)
293{ 312{
@@ -361,19 +380,8 @@ _elm_combobox_efl_object_constructor(Eo *obj, Elm_Combobox_Data *sd)
361 snprintf(buf, sizeof(buf), "combobox_vertical/%s", elm_widget_style_get(obj)); 380 snprintf(buf, sizeof(buf), "combobox_vertical/%s", elm_widget_style_get(obj));
362 381
363 //hover 382 //hover
364 if (elm_widget_is_legacy(obj)) 383 sd->hover = _elm_combobox_component_add(obj, sd->hover_parent, ELM_HOVER_CLASS, buf);
365 { 384 efl_gfx_visible_set(sd->hover, EINA_FALSE);
366 sd->hover = elm_legacy_add(ELM_HOVER_CLASS, sd->hover_parent,
367 efl_gfx_visible_set(efl_added, EINA_FALSE),
368 efl_ui_widget_style_set(efl_added, buf));
369 }
370 else
371 {
372 sd->hover = efl_add(ELM_HOVER_CLASS, sd->hover_parent,
373 efl_gfx_visible_set(efl_added, EINA_FALSE),
374 efl_ui_widget_style_set(efl_added, buf));
375 }
376
377 evas_object_layer_set(sd->hover, EVAS_LAYER_MAX); 385 evas_object_layer_set(sd->hover, EVAS_LAYER_MAX);
378 efl_ui_mirrored_automatic_set(sd->hover, EINA_FALSE); 386 efl_ui_mirrored_automatic_set(sd->hover, EINA_FALSE);
379 elm_hover_target_set(sd->hover, obj); 387 elm_hover_target_set(sd->hover, obj);
@@ -397,8 +405,7 @@ _elm_combobox_efl_object_constructor(Eo *obj, Elm_Combobox_Data *sd)
397 elm_table_pack(sd->tbl, sd->spacer, 0, 0, 1, 1); 405 elm_table_pack(sd->tbl, sd->spacer, 0, 0, 1, 1);
398 406
399 // This is the genlist object that will take over the genlist call 407 // This is the genlist object that will take over the genlist call
400 sd->genlist = gl = efl_add(ELM_GENLIST_CLASS, obj, 408 sd->genlist = gl = _elm_combobox_component_add(obj, obj, ELM_GENLIST_CLASS, buf);
401 efl_ui_widget_style_set(efl_added, buf));
402 elm_genlist_filter_set(gl, NULL); 409 elm_genlist_filter_set(gl, NULL);
403 efl_ui_mirrored_automatic_set(gl, EINA_FALSE); 410 efl_ui_mirrored_automatic_set(gl, EINA_FALSE);
404 efl_ui_mirrored_set(gl, efl_ui_mirrored_get(obj)); 411 efl_ui_mirrored_set(gl, efl_ui_mirrored_get(obj));
@@ -412,8 +419,7 @@ _elm_combobox_efl_object_constructor(Eo *obj, Elm_Combobox_Data *sd)
412 elm_table_pack(sd->tbl, gl, 0, 0, 1, 1); 419 elm_table_pack(sd->tbl, gl, 0, 0, 1, 1);
413 420
414 // This is the entry object that will take over the entry call 421 // This is the entry object that will take over the entry call
415 sd->entry = entry = efl_add(ELM_ENTRY_CLASS, obj, 422 sd->entry = entry = _elm_combobox_component_add(obj, obj, ELM_ENTRY_CLASS, buf);
416 efl_ui_widget_style_set(efl_added, buf));
417 efl_ui_mirrored_automatic_set(entry, EINA_FALSE); 423 efl_ui_mirrored_automatic_set(entry, EINA_FALSE);
418 efl_ui_mirrored_set(entry, efl_ui_mirrored_get(obj)); 424 efl_ui_mirrored_set(entry, efl_ui_mirrored_get(obj));
419 elm_scroller_policy_set(entry, ELM_SCROLLER_POLICY_OFF, 425 elm_scroller_policy_set(entry, ELM_SCROLLER_POLICY_OFF,