X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetCollapsable.cpp;h=7a4c99952ddb38d3ce705fcea4d1f2ab36ac94b5;hb=e8c932ff842ced0b26c205ed6983102b6e7e50c2;hp=668a91896ac1704c97cfb480de74d614cef1f626;hpb=e35110eab7a540deaf8dc52483f1e5a55a773f46;p=lyx.git diff --git a/src/insets/InsetCollapsable.cpp b/src/insets/InsetCollapsable.cpp index 668a91896a..7a4c99952d 100644 --- a/src/insets/InsetCollapsable.cpp +++ b/src/insets/InsetCollapsable.cpp @@ -258,7 +258,7 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const view_[&bv].button_dim_.y2 = 0; } - Dimension const textdim = InsetText::dimension(bv); + Dimension const textdim = dimensionHelper(bv); int const baseline = y; int textx, texty; Geometry g = geometry(bv); @@ -274,8 +274,9 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const } // Do not draw the cue for INSERTED -- it is already in the button and // that's enough. - Changer dummy = make_change(pi.change_, Change(), - pi.change_.type == Change::INSERTED); + Changer dummy = (pi.change_.type == Change::INSERTED) + ? make_change(pi.change_, Change()) + : Changer(); InsetText::draw(pi, textx, texty); break; } @@ -333,10 +334,11 @@ 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, Color_none, Color_none); + buttonLabel(bv), font, col, Color_none); } int const y1 = y - textdim.asc + 3; @@ -364,7 +366,7 @@ void InsetCollapsable::cursorPos(BufferView const & bv, status_ = Open; InsetText::cursorPos(bv, sl, boundary, x, y); - Dimension const textdim = InsetText::dimension(bv); + Dimension const textdim = dimensionHelper(bv); switch (geometry(bv)) { case LeftButton: