Comment 59 for bug 968213

Revision history for this message
In , Pierre-bugzilla (pierre-bugzilla) wrote :

Looking further at this, I'm not sure how the current request/allocation methods can resolve this properly. Either there are more methods, or the proposed design is impossible in the current architecture.

Basically I reimplemented clutter_actor_allocate_align_fill() in iconGrid.js. This method fails to handle text wrapping correctly:

 a) The actor is asked for a natural width, given a limited height. It will compute a layout without line breaks, given that available width is infinite.

 b) The actor is asked for a natural height, given a limited width. It will now be forced to wrap the lines to compute a multi-line height.

 c) Width would now have to be recomputed, given that the line wrapping will most likely not require the full available width. Failure to do so adds extra padding to these icons.

As far as I can tell, there is no way to do c). Basically the layout system would need a way to ask for BOTH width and height at the same time, not independently.

So I see two options here:

 1. Abandon the proposed design because it cannot be implemented in the current structure.

 2. Reorganise the widget hierarchy. The highlighted area needs to be owned by BaseIcon, as it is the only part of the code which can compute its dimensions correctly.