Change tracking cue: for instant preview

Strike through deleted previews (expect for inline math where it is already taken care of by RowPainter).
This commit is contained in:
Guillaume Munch 2016-05-23 15:44:29 +01:00
parent de786bfcdf
commit 8e1a869c45
3 changed files with 15 additions and 8 deletions

View File

@ -69,6 +69,8 @@ public:
void write(std::ostream & os) const;
void edit(Cursor & cur, bool front, EntryDirection entry_from);
bool canPaintChange(BufferView const &) const { return true; };
//@}
protected:

View File

@ -193,6 +193,8 @@ void RenderPreview::draw(PainterInfo & pi, int x, int y) const
y - theFontMetrics(font).maxAscent() - 4,
stat, font);
}
pi.change_.paintCue(pi, x, y - dim_.asc,
x + dim_.width(), y - dim_.asc + dim_.height());
}

View File

@ -59,11 +59,12 @@
#include "frontends/Painter.h"
#include "support/convert.h"
#include "support/lassert.h"
#include "support/debug.h"
#include "support/filetools.h"
#include "support/gettext.h"
#include "support/filetools.h"
#include "support/lassert.h"
#include "support/lstrings.h"
#include "support/RefChanger.h"
#include <sstream>
@ -567,7 +568,9 @@ void InsetMathHull::draw(PainterInfo & pi, int x, int y) const
}
if (previewState(bv)) {
// FIXME CT this
// Do not draw change tracking cue if taken care of by RowPainter
// already.
Changer dummy = make_change(pi.change_, Change(), !canPaintChange(*bv));
if (previewTooSmall(dim)) {
// we have an extra frame
preview_->draw(pi, x + ERROR_FRAME_WIDTH, y);