]> git.lyx.org Git - features.git/commitdiff
Fix drawing of collpsable insets
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 7 Jun 2017 10:20:33 +0000 (12:20 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 7 Jun 2017 10:20:33 +0000 (12:20 +0200)
This is a follow-up to e194c9ce. There was actually no reason to let
InsetCollapsable and InsetText draw their own background. It is more
correct to remove the existing code and let the generic
Inset::drawBackground take command.

This allows to revert d207e85c.

Fixes bug #10587.

src/insets/InsetCollapsable.cpp
src/insets/InsetCollapsable.h
src/insets/InsetText.cpp
src/insets/InsetText.h

index 92802b96d4bd0fb44b462694e00f1ebaffd12a16..213e058b0680acf8c20a4d79c1bc0f5917f6ee21 100644 (file)
@@ -335,11 +335,10 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const
                        int w = 0;
                        int a = 0;
                        int d = 0;
-                       Color const col = pi.full_repaint ? Color_none : pi.backgroundColor(this);
                        theFontMetrics(font).rectText(buttonLabel(bv), w, a, d);
                        int const ww = max(textdim.wid, w);
                        pi.pain.rectText(x + (ww - w) / 2, y + desc + a,
-                                        buttonLabel(bv), font, col, Color_none);
+                                        buttonLabel(bv), font, Color_none, Color_none);
                }
 
                int const y1 = y - textdim.asc + 3;
index a426db034ab12903057c96fd01fce67b0bb5d2af..4c08bdc7978e7e1df4539b79eef22a9470b9b86e 100644 (file)
@@ -54,8 +54,6 @@ public:
        void metrics(MetricsInfo &, Dimension &) const;
        ///
        void draw(PainterInfo & pi, int x, int y) const;
-       ///
-       virtual void drawBackground(PainterInfo &, int, int) const {}
 
        /// return x,y of given position relative to the inset's baseline
        void cursorPos(BufferView const & bv, CursorSlice const & sl,
index 7680ee5fa925d8e06d4b0402c5bf143aa4ce12a5..2e60692f3c182326d2a9f63c9ceb5ea2249969fc 100644 (file)
@@ -221,10 +221,6 @@ void InsetText::draw(PainterInfo & pi, int x, int y) const
        int const xframe = x + TEXT_TO_INSET_OFFSET / 2;
        bool change_drawn = false;
        if (drawFrame_ || pi.full_repaint) {
-               if (pi.full_repaint)
-                       pi.pain.fillRectangle(xframe, yframe, w, h,
-                               pi.backgroundColor(this));
-
                // Change color of the frame in tracked changes, like for tabulars.
                // Only do so if the color is not custom. But do so even if RowPainter
                // handles the strike-through already.
index eb52bc81b66020c1e68de411a831d3f6d869a18e..bfaee44241ea5db1b108ce387a5cbf6806d4e7d0 100644 (file)
@@ -60,8 +60,6 @@ public:
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
        void draw(PainterInfo & pi, int x, int y) const;
-       /// Drawing background is handled in draw
-       virtual void drawBackground(PainterInfo &, int, int) const {}
        ///
        bool editable() const { return true; }
        ///