Re: r19968 - in /lyx-devel/trunk/src: TextMetrics.cpp insets/...

2007-09-02 Thread Martin Vermeer
On Sun, Sep 02, 2007 at 12:37:58PM +0200, Abdelrazak Younes wrote: > Alfredo Braunstein wrote: > > [ I still don't get the 2 * but probably it's a safety margin to account > > for > > all TEXT_TO_INSET_OFFSET and such. > > I tested without the factor 2 and it works fine so I changed that. It's

Re: r19968 - in /lyx-devel/trunk/src: TextMetrics.cpp insets/...

2007-09-02 Thread Abdelrazak Younes
Alfredo Braunstein wrote: [ I still don't get the 2 * but probably it's a safety margin to account for all TEXT_TO_INSET_OFFSET and such. I tested without the factor 2 and it works fine so I changed that. It's very cool to see nested insets automatically adjusting their sizes when resizing th

Re: r19968 - in /lyx-devel/trunk/src: TextMetrics.cpp insets/...

2007-09-02 Thread Abdelrazak Younes
Alfredo Braunstein wrote: Abdelrazak Younes wrote: Sure, IIUC ideally we should test if the inset just fits inlined with the button or not. But the reference width here should be the textwidth_, not the screen width (think about deeply nested stuff). Previsouly we had (rev 14161): openinl

Re: r19968 - in /lyx-devel/trunk/src: TextMetrics.cpp insets/...

2007-09-02 Thread Alfredo Braunstein
Abdelrazak Younes wrote: >>> Sure, IIUC ideally we should test if the inset just fits inlined with >>> the button or not. But the reference width here should be the >>> textwidth_, not the screen width (think about deeply nested stuff). >> >> Previsouly we had (rev 14161): >> >> openinlined_

Re: r19968 - in /lyx-devel/trunk/src: TextMetrics.cpp insets/...

2007-09-01 Thread Martin Vermeer
On Sun, Sep 02, 2007 at 12:46:00AM +0200, Abdelrazak Younes wrote: > Alfredo Braunstein wrote: > > Abdelrazak Younes wrote: > >>> But what about deeply nested stuff, or stuff inside minipages etc. It > >>> seems difficult to come up with good heuristics to avoid that metrics > >>> call without usi

Re: r19968 - in /lyx-devel/trunk/src: TextMetrics.cpp insets/...

2007-09-01 Thread Martin Vermeer
On Sun, Sep 02, 2007 at 12:29:50AM +0200, Abdelrazak Younes wrote: > Alfredo Braunstein wrote: > > Abdelrazak Younes wrote: > >>> 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

Re: r19968 - in /lyx-devel/trunk/src: TextMetrics.cpp insets/...

2007-09-01 Thread Abdelrazak Younes
Abdelrazak Younes wrote: Alfredo Braunstein wrote: Abdelrazak Younes wrote: But what about deeply nested stuff, or stuff inside minipages etc. It seems difficult to come up with good heuristics to avoid that metrics call without using textwidth. I think that by testing he dimension of the but

Re: r19968 - in /lyx-devel/trunk/src: TextMetrics.cpp insets/...

2007-09-01 Thread Abdelrazak Younes
Alfredo Braunstein wrote: Abdelrazak Younes wrote: But what about deeply nested stuff, or stuff inside minipages etc. It seems difficult to come up with good heuristics to avoid that metrics call without using textwidth. I think that by testing he dimension of the button and if we forbid openi

Re: r19968 - in /lyx-devel/trunk/src: TextMetrics.cpp insets/...

2007-09-01 Thread Abdelrazak Younes
Alfredo Braunstein wrote: Abdelrazak Younes wrote: But what about deeply nested stuff, or stuff inside minipages etc. It seems difficult to come up with good heuristics to avoid that metrics call without using textwidth. I think that by testing he dimension of the button and if we forbid openi

Re: r19968 - in /lyx-devel/trunk/src: TextMetrics.cpp insets/...

2007-09-01 Thread Abdelrazak Younes
Alfredo Braunstein wrote: Could you remind me why of the comment "// This expression should not contain mi.base.texwidth" of line InsetCollapsable:212 ? svn blame tells me: 211 1447217/07/2006 07:30:36 vermeer Abdel.

Re: r19968 - in /lyx-devel/trunk/src: TextMetrics.cpp insets/...

2007-09-01 Thread Alfredo Braunstein
Abdelrazak Younes wrote: >> But what about deeply nested stuff, or stuff inside minipages etc. It >> seems difficult to come up with good heuristics to avoid that metrics >> call without using textwidth. > > I think that by testing he dimension of the button and if we forbid > openinlined if the

Re: r19968 - in /lyx-devel/trunk/src: TextMetrics.cpp insets/...

2007-09-01 Thread Abdelrazak Younes
Alfredo Braunstein wrote: Abdelrazak Younes wrote: 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

Re: r19968 - in /lyx-devel/trunk/src: TextMetrics.cpp insets/...

2007-09-01 Thread Alfredo Braunstein
Abdelrazak Younes wrote: >> 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

Re: r19968 - in /lyx-devel/trunk/src: TextMetrics.cpp insets/...

2007-09-01 Thread Abdelrazak Younes
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 @@ open

Re: r19968 - in /lyx-devel/trunk/src: TextMetrics.cpp insets/...

2007-09-01 Thread Alfredo Braunstein
== > --- 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_ = !hasFixedWid