make insanely huge icon scale with screen size, this is broken somehow because of some icon sizing bug

SVN revision: 65562
This commit is contained in:
Mike Blumenkrantz 2011-11-24 05:07:23 +00:00
parent 0a7bec205b
commit 45e5c083c3
1 changed files with 13 additions and 1 deletions

View File

@ -142,11 +142,23 @@ _tt_item_icon3(void *data __UNUSED__,
Evas_Object *tt,
void *item __UNUSED__)
{
int w, h, sw, sh;
Evas_Object *ic = elm_icon_add(tt);
char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "%s/images/insanely_huge_test_image.jpg", elm_app_data_dir_get());
elm_icon_file_set(ic, buf, NULL);
elm_icon_scale_set(ic, 0, 0);
elm_icon_size_get(ic, &w, &h);
elm_win_screen_size_get(tt, NULL, NULL, &sw, &sh);
if ((w > sw) || (h > sh))
{
float sc = 0;
if ((float)w / (float)sw >= 0.8)
sc = ((float)sw * 0.8) / (float)w;
else if ((float)h / (float)sh >= 0.8)
sc = ((float)sh * 0.8) / (float)h;
if (sc) elm_object_scale_set(ic, sc);
}
return ic;
}