How to change the size of List element in EFL

462 Views Asked by At

I was trying to change the size of the list element which are added in elementary list function ( elm_list_add) using append or prepend functions that calls _item_new internally in elm_list.c.

I want to change the size of list element with the icon/image I add. The list should resize according to every icon added not according to the largest icon/image added. I have also unset elm_box_homogeneous_set(priv->box, EINA_FALSE)in elm_list.c which was originally EINA_TRUE. Or should I need to make changes in edc file list.edc.

How Can I resize the List element according to image added in EFL?

2

There are 2 best solutions below

0
On

Do you want to resize each list item according to its icon/image size? Thus make item sizes different.

First of all, which version of elementary do you use? Secondly, are you sure you want to modify elementary library by yourself?

Well, if you modify elementary list, you can achieve it. In _item_new function, set VIEW(it)'s horizontal align to 0.0.

evas_object_size_hint_align_set(VIEW(it), 0.0, EVAS_HINT_FILL);
0
On

Once the homogeneous mode is set to true, your list should resize according to the content size. So it depends on the style. In worst case, you can write your own item style for the list and incorporate it while appending items. Currently, EFL provides Genlist which is stronger than basic list widget