]> git.lyx.org Git - features.git/commitdiff
Markup changed captions in workarea by underline and strikeout, resp.
authorJuergen Spitzmueller <spitz@lyx.org>
Fri, 6 Mar 2020 17:58:25 +0000 (18:58 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Fri, 6 Mar 2020 17:58:25 +0000 (18:58 +0100)
src/insets/InsetCaption.cpp
src/insets/InsetCaption.h

index 6b20876b5b0080bc8cd5ebfb5ac47f311cd9b8e7..3f1aebf99e103c923260159f5e32912ce8b70874 100644 (file)
@@ -53,7 +53,7 @@ namespace lyx {
 
 InsetCaption::InsetCaption(Buffer * buf, string const & type)
     : InsetText(buf, InsetText::PlainLayout),
-      labelwidth_(0), is_subfloat_(false), type_(type)
+      labelwidth_(0), is_subfloat_(false), is_deleted_(false), type_(type)
 {
        setDrawFrame(true);
        setFrameColor(Color_collapsibleframe);
@@ -150,6 +150,10 @@ void InsetCaption::draw(PainterInfo & pi, int x, int y) const
        FontInfo tmpfont = pi.base.font;
        pi.base.font = pi.base.bv->buffer().params().getFont().fontInfo();
        pi.base.font.setColor(pi.textColor(pi.base.font.color()).baseColor);
+       if (is_deleted_)
+               pi.base.font.setStrikeout(FONT_ON);
+       else if (isChanged())
+               pi.base.font.setUnderbar(FONT_ON);
        int const xx = x + leftOffset(pi.base.bv);
        pi.pain.text(xx, y, full_label_, pi.base.font);
        InsetText::draw(pi, x + labelwidth_, y);
@@ -380,6 +384,7 @@ void InsetCaption::updateBuffer(ParIterator const & it, UpdateType utype, bool c
                // counters are local to the caption
                cnts.saveLastCounter();
        }
+       is_deleted_ = deleted;
        // Memorize type for addToToc().
        floattype_ = type;
        if (type.empty() || type == "senseless")
index a1d14659fbf387c143ce747e6aa26b2aca03b52d..a651a71a5641be5e9dfcd3e0df51be982dba31b7 100644 (file)
@@ -98,6 +98,8 @@ private:
        ///
        bool is_subfloat_;
        ///
+       bool is_deleted_;
+       ///
        std::string type_;
 };