Le 06/10/2015 00:34, Pavel Sanda a écrit :
Jean-Marc Lasgouttes wrote:
Le 03/10/2015 01:27, Pavel Sanda a écrit :
Jean-Marc Lasgouttes wrote:
Why not do it in InsetText::Metrics directly? Is it a box-only problem?
Hmm, is there another insettext which allows fixing to certain percentage
of screen size width? Wrapping float came to my mind but apparently
it does not try to visualize the width set. No other inset came to my
mind.
You should not have to care about it.
Why? We definitely don't want to do this change for one-liner insets like
branch or insets without button like ERT.
The code in IntextText::metrics does:
// This can happen when a layout has a left and right margin,
// and the view is made very narrow. We can't do better than
// to draw it partly out of view (bug 5890).
if (mi.base.textwidth < 1)
mi.base.textwidth = 1;
if (hasFixedWidth())
tm.metrics(mi, dim, mi.base.textwidth);
else
tm.metrics(mi, dim);
So (1) it is a nice place to set a minimum width and (2) it is possible
to condition on fixed-width insets.
I thought that zoom is already taken into account in the patch sent, e.g.
button size is already calculated wrt zoom.
I agree that in the case of boxes, button size makes sense. Then you can
put your code in InsetCollapsable::metrics :)
JMarc