Alfredo Braunstein wrote:
==============================================================================
--- lyx-devel/trunk/src/insets/InsetCollapsable.cpp (original)
+++ lyx-devel/trunk/src/insets/InsetCollapsable.cpp Sat Sep 1 11:24:20
2007
@@ -213,13 +213,7 @@
openinlined_ = !hasFixedWidth()
&& textdim_.wid < 0.5 *
mi.base.bv->workWidth();
if (openinlined_) {
- // FIXME: this is not ideal but we need to
clear it
- // out because the Row::changed() status
is reset.
- mi.base.bv->textMetrics(&text_).clear();
- // Correct for button width, and re-fit
- mi.base.textwidth -= dim.wid;
- InsetText::metrics(mi, textdim_);
- mi.base.textwidth += dim.wid;
+ // Correct for button width.
dim.wid += textdim_.wid;
How can this work? You have to compute metrics on the restricted textwidth
(less the button width) because that's how it's painted after.
That's because the InsetText dimension doesn't change, it stays lower
that 0.5 * workWidth, no matter if there's a button before. I assumed
blindly that the button width will fit in the remaining half screen but
I guess I am wrong and we need to make sure of that. In general this
should just work though because nobody will work with a work area which
width is less the size of a float button... I guess, I'll try it out...
Thanks,
Abdel.