On 23-Jul-2001 Jean-Marc Lasgouttes wrote:

> Juergen> IMO your getting this on the wrong spot. What we have to do
> Juergen> is define a Background-color for general LyXText and this
> Juergen> should be as easy as ALWAYS pass the background color on ALL
> Juergen> draw actions (clearing is ALSO a draw action!). 
> 
> What do you think I did? Use directly oil paint on the screen?

Well you never know. What did you drink today? #:O)

> The problem is that, when you uncollapse an inset, new rows (or
> whatever) are created and cleared to the color of the doc background.
> And then lyxtext tells the inset that it does not have to clear its
> own background, since it has already been done. And then the drawing
> sucks.

Hmmm strange! We already return in doClearArea:

bool InsetText::doClearArea() const
{
        return !locked || (need_update & (FULL|INIT));
}

So this should cover the above situation, hmmm, let me see, hmmm, if
it does not work it means that we don't set the need_update in the right
functions. One of this functions could be the InsetCollapsable::edit()
and InsetCollapsable::insetButtonRelease() functions. Try to apply the
following and see if it helps! After this the outer LyXText should clear
the row with it's color and we then draw it with our color!

Index: insetcollapsable.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcollapsable.C,v
retrieving revision 1.73
diff -u -p -u -r1.73 insetcollapsable.C
--- insetcollapsable.C  2001/07/23 13:44:23     1.73
+++ insetcollapsable.C  2001/07/23 14:14:26
@@ -264,6 +264,7 @@ void InsetCollapsable::edit(BufferView *
                collapsed_ = false;
                if (!bv->lockInset(this))
                        return;
+               inset.setUpdateStatus(bv, InsetText::FULL);
                bv->updateInset(this, false);
                inset.edit(bv, front);
        } else {
@@ -322,6 +323,7 @@ void InsetCollapsable::insetButtonReleas
                        draw_label = label;
                        collapsed_ = false;
                        inset.insetButtonRelease(bv, 0, 0, button);
+                       inset.setUpdateStatus(bv, InsetText::FULL);
                        bv->updateInset(this, false);
                } else {
                        if (change_label_with_text) {

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen Vigna        E-Mail:  [EMAIL PROTECTED]
Italienallee 13/N       Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen           Web:     http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

It's a funny thing that when a woman hasn't got anything
on earth to worry about, she goes off and gets married.

Reply via email to