]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCollapsable.cpp
(InsetCollapsable::draw) restore background color (avoid psychedelic effects when...
[lyx.git] / src / insets / InsetCollapsable.cpp
index 826b2a3c5a906c855041252560884b06d0017c96..c634092c025b7036cffc55625626ff58bca57d7d 100644 (file)
@@ -244,8 +244,9 @@ bool InsetCollapsable::setMouseHover(bool mouse_hover)
 void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const
 {
        autoOpen_ = pi.base.bv->cursor().isInside(this);
+       int const old_color = pi.background_color;
        pi.background_color = backgroundColor();
-       const int xx = x + TEXT_TO_INSET_OFFSET;
+       int const xx = x + TEXT_TO_INSET_OFFSET;
 
        // Draw button first -- top, left or only
        Dimension dimc = dimensionCollapsed();
@@ -352,6 +353,7 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const
                break;
        }
        setPosCache(pi, x, y);
+       pi.background_color = old_color;
 }