forked from enlightenment/efl
layout: test code refactoring.
remove a comment. pass immediate parents. remove unnecessary show call.
This commit is contained in:
parent
a908bd3646
commit
d8e157771e
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue