void
test_icon(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
- Evas_Object *win, *box, *hbox, *tg, *bt;
- win = elm_win_util_standard_add("icon test", "Icon Test");
+ Evas_Object *win, *box, *ic, *hbox, *tg, *bt;
+ char buf[PATH_MAX];
+
+ win = elm_win_util_standard_add("icon-test", "Icon Test");
elm_win_autodel_set(win, EINA_TRUE);
+ evas_object_resize(win, 400, 400);
+ evas_object_show(win);
box = elm_box_add(win);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, box);
evas_object_show(box);
- Evas_Object *ic = elm_icon_add(win);
- char buf[PATH_MAX];
+ ic = elm_icon_add(box);
snprintf(buf, sizeof(buf), "%s/images/logo.png", elm_app_data_dir_get());
elm_image_file_set(ic, buf, NULL);
elm_image_resizable_set(ic, EINA_TRUE, EINA_TRUE);
evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(ic, EVAS_HINT_FILL, EVAS_HINT_FILL);
-
elm_box_pack_end(box, ic);
evas_object_show(ic);
- hbox = elm_box_add(win);
+ hbox = elm_box_add(box);
elm_box_horizontal_set(hbox, EINA_TRUE);
evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, 0.0);
elm_box_pack_end(box, hbox);
evas_object_show(hbox);
/* Test Aspect Fixed */
- tg = elm_check_add(win);
+ tg = elm_check_add(hbox);
elm_object_text_set(tg, "Aspect Fixed");
elm_check_state_set(tg, EINA_TRUE);
evas_object_smart_callback_add(tg, "changed", aspect_fixed_cb, ic);
evas_object_show(tg);
/* Test Fill Outside */
- tg = elm_check_add(win);
+ tg = elm_check_add(hbox);
elm_object_text_set(tg, "Fill Outside");
evas_object_smart_callback_add(tg, "changed", fill_outside_cb, ic);
elm_box_pack_end(hbox, tg);
evas_object_show(tg);
/* Test Smooth */
- tg = elm_check_add(win);
+ tg = elm_check_add(hbox);
elm_object_text_set(tg, "Smooth");
elm_check_state_set(tg, EINA_TRUE);
evas_object_smart_callback_add(tg, "changed", smooth_cb, ic);
evas_object_show(tg);
/* Test Preload, Prescale */
- bt = elm_button_add(win);
+ bt = elm_button_add(hbox);
elm_object_text_set(bt, "Preload & Prescale");
evas_object_smart_callback_add(bt, "clicked", bt_clicked, NULL);
elm_box_pack_end(hbox, bt);
evas_object_show(bt);
-
- evas_object_resize(win, 400, 400);
- evas_object_show(win);
}
static void