On Wednesday, June 30, 2010 04:51:40 am Koen Deforche wrote:
> Hey Mike,
> 
> 2010/6/23 Mike Teehan <[email protected]>:
> > Greetings all,
> > 
> > It the course of all my hacking today, I've managed to assemble a test
> > case that shows some sort of layout rendering bug.  Clicking on the
> > "preview" column in the test case should hide the "editor" and show a
> > second preview column, suitable for printing.  The editor hide()s
> > properly, and the second preview show()s up, but instead of being on the
> > left side of the browser, they are on the right.  Firebug leads me to
> > believe that the editor is hiding its content, but still somehow taking
> > up space.
> 
> The main gotcha here is that a layout manager does not consider the
> visibility of a widget (hidden or shown) when doing the layout. Thus,
> although the editor is being hidden, it is still configured in the
> layout manager as taking up all excess space (ltr->addWidget(_editor,
> 1)).

It's not a bug -- it's a feature!

> I would be curious to what Qt does in this case. I would assume that
> the right thing to do is to ignore a hidden widget entirely in the
> layout (as if it was not inserted at all -- thus also ignoring any
> padding that is associated with it). If that is the case, we'll need a
> feature/bug request for this.

Hiding a widget in a Qt layout definitely makes it disappear from the layout, 
and triggers all the other widgets in the layout to reflow.  This would be a 
much more intuitive default behavior for Wt, perhaps in combination with 
WWebWidget::setHiddenKeepsGeometry to preserve the old behavior? 

I have made a feature request on Redmine.

> The modified test case below removes and re-inserts the _editor in the
> layout, instead of just hiding and showing it. Is that the behaviour
> you are looking for?

Yes.  It works very nicely.  Thank you.

Mike

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to