Page MenuHomePhabricator

genlist w/ ELM_LIST_EXPAND doesn't respect the max size hints
Closed, InvalidPublic


I've created 2 examples to demonstrate, frame_example_02 shows the desired results with a list widget, and frame_example_03 shows a genlist that doesn't restrict itself and thus extends the widget.

unixtaker created this task.Dec 7 2015, 6:24 PM
unixtaker updated the task description. (Show Details)
unixtaker raised the priority of this task from to Incoming Queue.
unixtaker added a project: Restricted Project.
unixtaker added a subscriber: unixtaker.

I've patched elm_genlist.c to "fix" the problem for these examples, not sure what the side effects are. The example genlist applications appear to be working for me.

stephenmhouston triaged this task as Normal priority.Dec 9 2015, 11:24 AM
stephenmhouston claimed this task.


I found this to not be a bug, but a misunderstanding in the way to handle the widget layout here. Please see the attached file of the proper way to handle this. Thank you.


stephenmhouston closed this task as Invalid.Dec 9 2015, 11:25 AM
kuuko reopened this task as Open.Dec 9 2015, 11:59 AM
kuuko added a subscriber: kuuko.


I found this to not be a bug, but a misunderstanding in the way to handle the widget layout here. Please see the attached file of the proper way to handle this. Thank you.


I disagree. Your solution does provide an alternate way to implement what the user wishes to accomplish but this really is a bug.

Documentation specifically mentions the use of externally set max size hints when a list container is set to ELM_LIST_EXPAND, the use of which Genlist doesn't respect.

ELM_LIST_EXPAND, /** Besides setting a minimum size on the transverse axis,
                  * just like on @ref Elm_List_Mode.ELM_LIST_LIMIT, the list
                  * will set a minimum size on th longitudinal axis, trying
                  * to reserve space to all its children to be visible at a
                  * time. . This is naturally bound by the list object's
                  * maximum size hints, set externally. */
stephenmhouston closed this task as Invalid.Dec 9 2015, 12:17 PM

List and genlist do not work the same. They don't handle their sizing the same. List realizes all of its objects. Genlist does not. You are taking documentation out of place and assuming it works elsewhere. Here is the documentation for genlist_mode_set. Expand is not even there. Genlist doesn't work that way.


  • @brief This sets the horizontal stretching mode. *
  • This sets the mode used for sizing items horizontally. Valid modes are
  • #ELM_LIST_SCROLL. This mode means that if items are too wide to fit, the
  • scroller will scroll horizontally. Otherwise items are expanded to fill the
  • width of the viewport of the scroller. If it is #ELM_LIST_LIMIT, items will
  • be expanded to the viewport width and limited to that size. If it is
  • #ELM_LIST_COMPRESS, the item width will be fixed (restricted to a minimum
  • of) to the list width when calculating its size in order to allow the height
  • to be calculated based on it. This allows, for instance, text block to wrap
  • lines if the Edje part is configured with "text.min: 0 1". *
  • @note #ELM_LIST_COMPRESS will make list resize slower as it will have to
  • recalculate every item height again whenever the list width changes! *
  • @note Homogeneous mode is for that all items in the genlist same
  • width/height. With #ELM_LIST_COMPRESS, it makes genlist items to fast
  • initializing. However there's no sub-objects in genlist which can be on the
  • flying resizable (such as TEXTBLOCK). If then, some dynamic esizable objects
  • in genlist would not diplayed properly. *
  • @param[in] mode The mode to use (one of #ELM_LIST_SCROLL or
  • @ingroup Elm_Genlist */

EOAPI void elm_obj_genlist_mode_set(Elm_List_Mode mode);

stephenmhouston reopened this task as Open.Dec 9 2015, 1:23 PM

After looking at the code and doing some exploring... I have found that there are plenty of problems here. First of all, genlist_mode_set needs to have correct documentation related to whatever its purpose is... yeah yeah... nobody knows... I get it... kuuko pointed out that raster added the expand here: 33c6be230b20f92c522e80ce7ee323d13142adbb ... This seems out of place and contrary to the documentation as it affects height. Regardless... genlist's currecnt layout_eval does a really poor job of adhering to min/max hints. If the intent here is for mode_set to work like it does with list, then the eval needs to be rewritten.

stephenmhouston closed this task as Invalid.Dec 9 2015, 5:20 PM

Per conversation with raster, the expected behavior on genlist in a frame that you are getting is correct as I originally stated. It doesn't handle sizing this way. You have to include something else in the frame such as a table with an evas rect and genlist packed into the same cell and apply sizing to the rect to control the genlist size.

Okay, just for those curious and for reference, I have attached a fixed version of unixtaker's genlist example to show how to handle this by using a rectangle.

And here is a dirty example of how I would handle expanding the frame/list. Cheers.