On Wed, Oct 29, 2008 at 01:38:14PM -0300, Jorge Arellano Cid wrote:
On Wed, Oct 29, 2008 at 02:28:48PM +0000, Jeremy Henty wrote:
There's a bug in the downloads GUI that stops the download items resizing when the window does. The resizable of the window should be the scrollgroup, not the packedgroup. Fixing this means we don't need to explicitly resize the scrollgroup after removing an item (because the window has already resized it) so I took that out. Patch attached.
Oh, please excuse me not understanding what the bug is and how to reproduce it. Please explain with apples and pears! :-)
OK, fruit 'n' veg coming up! :-) Symptom: If you change the width of the download GUI window its contents do not respond. This is annoying because (a) if you narrow the window to save space then it truncates its contents at the right-hand side rather than gracefully resizing them, and (b) if you widen the window hoping that it will make the display more legible by widening the text labels etc. then nothing happens. It's an easy bug to miss because the result is not obviously wrong, just poor and inconvenient. Once you've seen the correct behaviour the improvement is obvious. Cause: FLTK's resize mechanism is controlled by the resizable members of the Group widgets. This is a pointer to the child of the group widget which the group should resize when its own size changes. The downloads GUI is buggy because it sets the resizable widget of the Window to be the PackedGroup that contains the download items, which is wrong because the PackedGroup is *not* a child of the Window, it's a child of the the ScrollGroup (which is in turn a child of the Window). The result is that the contents of the Window don't resize at all, except when the code tries to work around the bug by explicitly calling resize(). Fix: The code should make the ScrollGroup the resizable widget of the Window. (The ScrollGroup then properly resizes the PackedGroup without any further changes. I think this is because its type is set to VERTICAL.) This makes the width of the ScrollGroup (and hence the PackedGroup too) follow the width of the Window in a way that is beautiful to behold. :-) Now we don't need to explicitly resize the any of the widgets because FLTK does it all automatically whenever the width of the Window changes, so the call to resize() should be deleted. Apples and pears enough? :-) :-) Regards, Jeremy Henty