GNOME Bugzilla – Bug 611951
Fixes for resizing
Last modified: 2010-03-05 23:05:40 UTC
This implements pretty much everything described above other than caching for efficiency and width-for-height layout. The test case here (it's pretty neat, give it a try!) probably should replace scrolling.js - one thing that scrolling.js tests that this doesn't is a scrolled box with CSS borders, but that could be added as another togglable option, or maybe a border could just always be added to the scrolled area. One thing not noted in the commit message is that with this patch you can clutter_actor_hide() the scrollbars and they become invisible scrollbars. I'm not really sure why you would do this rather than just setting adjustments on the StBoxLayout and using it directly, but the feature has been asked for and it wasn't much code to do. Suggested review strategy: - Read this bug report - Try out the interactive test case to get a sense for how things work - Read the docs I added to St.Scrollable - Review the changes to St.BoxLayout - Read/skim through St.ScrollView with the patch applied - the size negotation code in get_preferred_width/height/ allocate and the code that hooks up the adjustments is probably easiest to read from scratch rather than as changes. I wouldn't worry too much about figuring out all the details of size negotiation - they seem to work pretty well from the interactive test and if there are subtle bugs, we'll fix them as necessary.
Created attachment 155376 [details] [review] Fixes for resizing StScrollable: Document how size negotation now works between the parent and scrollable child. StBoxLayout: Adapt to the new contract for how size negotiation works; in particular, handle being allocated less than the minimum size when scrolled and treat the minimum size as the size of the scrolled area in instead of the natural size. StScrollView: Substantially rewrite with fixes including: - Implement new size negotation contract; this allows us to determine scrollbar visibility without having to connect to the adjustment. - Implement all ALWAYS along with the existing NEVER/AUTO - When hiding and showing scrollbars and shadows, don't hide and show widgets, just turn on and off including them in pick and paint. This avoids queueing relayouts. - Cleanups for the code for connecting to adjustments, for changing policy, and for turning on and off shadows. scroll-view-sizing.js: New test case for StScrollView, allowing resizing the scroll view interactively, changing the scrollbar policies and turning shadows on and off. https://bugzilla.gnome.org/show_bug.cgi?id=611740
Meant to attach rather than file, now attached to the original bug, and duplicating this on that. *** This bug has been marked as a duplicate of bug 611740 ***