From: Hermet Park Date: Mon, 1 Feb 2016 13:35:23 +0000 (+0900) Subject: layout: test code refactoring. X-Git-Tag: upstream/1.20.0~7116^2~14^2~228 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d8e157771e1580991b19fbbeac10f17de1626322;p=platform%2Fupstream%2Fefl.git layout: test code refactoring. remove a comment. pass immediate parents. remove unnecessary show call. --- diff --git a/legacy/elementary/src/bin/test_layout.c b/legacy/elementary/src/bin/test_layout.c index 7b33cb4..fce1b93 100644 --- a/legacy/elementary/src/bin/test_layout.c +++ b/legacy/elementary/src/bin/test_layout.c @@ -54,7 +54,7 @@ test_layout(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in elm_win_resize_object_add(win, box); evas_object_show(box); - ly = elm_layout_add(win); + ly = elm_layout_add(box); if (!elm_layout_theme_set( ly, "layout", "application", "titlebar")) @@ -66,43 +66,39 @@ test_layout(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in elm_box_pack_end(box, ly); evas_object_show(ly); - bt = elm_icon_add(win); + bt = elm_icon_add(ly); elm_icon_standard_set(bt, "chat"); evas_object_size_hint_min_set(bt, 20, 20); elm_layout_icon_set(ly, bt); - bt = elm_icon_add(win); + bt = elm_icon_add(ly); elm_icon_standard_set(bt, "close"); evas_object_size_hint_min_set(bt, 20, 20); elm_layout_end_set(ly, bt); - ly = elm_layout_add(win); + ly = elm_layout_add(box); snprintf(buf, sizeof(buf), "%s/objects/test.edj", elm_app_data_dir_get()); elm_layout_file_set(ly, buf, "layout"); evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_box_pack_end(box, ly); - //elm_win_resize_object_add(win, ly); evas_object_show(ly); - + elm_layout_signal_callback_add(ly, "*", "*", _cb_signal, NULL); - bt = elm_button_add(win); + bt = elm_button_add(ly); elm_object_text_set(bt, "Button 1"); elm_object_part_content_set(ly, "element1", bt); evas_object_smart_callback_add(bt, "clicked", _clicked_cb, ly); - evas_object_show(bt); - bt = elm_button_add(win); + bt = elm_button_add(ly); elm_object_text_set(bt, "Button 2"); elm_object_part_content_set(ly, "element2", bt); evas_object_smart_callback_add(bt, "clicked", _clicked_cb, ly); - evas_object_show(bt); - bt = elm_button_add(win); + bt = elm_button_add(ly); elm_object_text_set(bt, "Button 3"); elm_object_part_content_set(ly, "element3", bt); evas_object_smart_callback_add(bt, "clicked", _clicked_cb, ly); - evas_object_show(bt); elm_layout_part_cursor_set(ly, "text", ELM_CURSOR_WATCH);