GNOME Bugzilla – Bug 595995
Allow NbtkBoxLayout to shrink down to its minimum size
Last modified: 2009-10-01 19:31:48 UTC
A patch to allow NbtkBoxLayout to shrink, and a minor bug-fix it depends upon.
Created attachment 143738 [details] [review] Don't count not-visible children among expand children When counting how many children we should divide extra space among, don't count not-visible children. http://bugzilla.moblin.org/show_bug.cgi?id=6310
Created attachment 143739 [details] [review] Allow NbtkBoxLayout to shrink down to its minimum size When a NbtkBoxLayout is allocated a size less than its natural size, think "shrink" needs to be divided among the children that have a smaller minimum size than natural size. This is done by preferentially shrinking the children that are most expanded from their minimum size and then increasing that set of children until we've found enough total shrink. A new method is used of allocating children at integral sizes - instead of rounding the per-child extra amount to an integer (which causes cumulative round-off errors), compute the position as we go along in floats and round individually for each child widget. Extend the box-layout test to include of a test of a box being set to various widths, starting quite narrow. http://bugzilla.moblin.org/show_bug.cgi?id=6311
Created attachment 144326 [details] [review] Don't count not-visible children among expand children When counting how many children we should divide extra space among, don't count not-visible children. http://bugzilla.moblin.org/show_bug.cgi?id=6310
Created attachment 144327 [details] [review] Allow StBoxLayout to shrink down to its minimum size When a StBoxLayout is allocated a size less than its natural size, think "shrink" needs to be divided among the children that have a smaller minimum size than natural size. This is done by preferentially shrinking the children that are most expanded from their minimum size and then increasing that set of children until we've found enough total shrink. A new method is used of allocating children at integral sizes - instead of rounding the per-child extra amount to an integer (which causes cumulative round-off errors), compute the position as we go along in floats and round individually for each child widget. Extend the box-layout test to include of a test of a box being set to various widths, starting quite narrow. http://bugzilla.moblin.org/show_bug.cgi?id=6311
Created attachment 144413 [details] [review] [StBoxLayout] initialize variable Small bug-fix. I'll squash this with the main patch before merging the shell-toolkit branch.
Review of attachment 144327 [details] [review]: Had to look twice at the logic in computing the shrink, but it all looks right to me. ::: src/st/st-box-layout.c @@ +614,3 @@ + * can shrink most, then shrink that and the next most shrinkable child, + * to the point where we are shrinling everything. + */ shrinking
Review of attachment 144413 [details] [review]: Remember to squash this when merging.
(In reply to comment #6) > Review of attachment 144327 [details] [review]: > > Had to look twice at the logic in computing the shrink, but it all looks right > to me. Any time you have to break out the ascii art in the comments to explain how it work, that's some kind of indicator...
Attachment 144326 [details] pushed as fa09f7a - Don't count not-visible children among expand children Attachment 144327 [details] pushed as 1ec8e9e - Allow StBoxLayout to shrink down to its minimum size