After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 595995 - Allow NbtkBoxLayout to shrink down to its minimum size
Allow NbtkBoxLayout to shrink down to its minimum size
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2009-09-22 19:16 UTC by Owen Taylor
Modified: 2009-10-01 19:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't count not-visible children among expand children (1.08 KB, patch)
2009-09-22 19:16 UTC, Owen Taylor
none Details | Review
Allow NbtkBoxLayout to shrink down to its minimum size (18.05 KB, patch)
2009-09-22 19:16 UTC, Owen Taylor
none Details | Review
Don't count not-visible children among expand children (1.05 KB, patch)
2009-09-30 00:15 UTC, Owen Taylor
committed Details | Review
Allow StBoxLayout to shrink down to its minimum size (17.99 KB, patch)
2009-09-30 00:15 UTC, Owen Taylor
committed Details | Review
[StBoxLayout] initialize variable (869 bytes, patch)
2009-09-30 16:03 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2009-09-22 19:16:05 UTC
A patch to allow NbtkBoxLayout to shrink, and a minor bug-fix
it depends upon.
Comment 1 Owen Taylor 2009-09-22 19:16:07 UTC
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
Comment 2 Owen Taylor 2009-09-22 19:16:10 UTC
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
Comment 3 Owen Taylor 2009-09-30 00:15:05 UTC
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
Comment 4 Owen Taylor 2009-09-30 00:15:45 UTC
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
Comment 5 Owen Taylor 2009-09-30 16:03:34 UTC
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.
Comment 6 Colin Walters 2009-09-30 21:09:42 UTC
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
Comment 7 Colin Walters 2009-09-30 21:10:17 UTC
Review of attachment 144413 [details] [review]:

Remember to squash this when merging.
Comment 8 Owen Taylor 2009-09-30 21:29:39 UTC
(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...
Comment 9 Owen Taylor 2009-10-01 19:31:41 UTC
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