widget gengrid: set icon aspect only for group_index and default_style.

This commit is contained in:
Daniel Juyung Seo 2012-12-03 02:54:38 +09:00
parent cefc749424
commit 8f24040a84
1 changed files with 31 additions and 10 deletions

View File

@ -186,8 +186,6 @@ _widget_gengrid_grid_check_content_get(void *data, Evas_Object *obj,
"%s/images/sky_0%d.jpg", elm_app_data_dir_get(), i);
elm_bg_file_set(o, buf, NULL);
evas_object_size_hint_aspect_set(o, EVAS_ASPECT_CONTROL_VERTICAL,
1, 1);
evas_object_show(o);
}
else if (!strcmp(part, "elm.swallow.end"))
@ -207,6 +205,32 @@ _widget_gengrid_content_get(void *data, Evas_Object *obj, const char *part)
char buf[PATH_MAX] = {0, };
int i = ((int)(long)data % 4) + 1;
if (!strcmp(part, "elm.swallow.icon"))
{
o = elm_bg_add(obj);
snprintf(buf, sizeof(buf),
"%s/images/sky_0%d.jpg", elm_app_data_dir_get(), i);
elm_bg_file_set(o, buf, NULL);
evas_object_show(o);
}
else if (!strcmp(part, "elm.swallow.end"))
{
o = elm_check_add(obj);
evas_object_propagate_events_set(o, EINA_FALSE);
evas_object_show(o);
}
return o;
}
static Evas_Object *
_widget_gengrid_icon_aspect_content_get(void *data, Evas_Object *obj,
const char *part)
{
Evas_Object *o = NULL;
char buf[PATH_MAX] = {0, };
int i = ((int)(long)data % 4) + 1;
if (!strcmp(part, "elm.swallow.icon"))
{
o = elm_bg_add(obj);
@ -236,6 +260,7 @@ _widget_gengrid_create(const char *orig_style, const char *style)
char buf[PATH_MAX] = {0, };
o = elm_gengrid_add(win);
elm_gengrid_item_size_set(o, 168, 168);
EXPAND(o); FILL(o);
evas_object_show(o);
@ -253,15 +278,11 @@ _widget_gengrid_create(const char *orig_style, const char *style)
/* check for special custom style for h9 grid-check-style */
if (!strcmp("h9 grid-check-style", orig_style))
{
ic->func.content_get = _widget_gengrid_grid_check_content_get;
elm_gengrid_item_size_set(o, 150, 163);
}
ic->func.content_get = _widget_gengrid_grid_check_content_get;
else if (!strcmp("group_index", style) || !strcmp("default_style", style))
ic->func.content_get = _widget_gengrid_icon_aspect_content_get;
else
{
ic->func.content_get = _widget_gengrid_content_get;
elm_gengrid_item_size_set(o, 150, 150);
}
ic->func.content_get = _widget_gengrid_content_get;
for (i = 0; i < 50; i++)
{