// Draw the change tracking cue on the label, unless RowPainter already
// takes care of it.
if (canPaintChange(bv))
- pi.change_.paintCue(pi, x, y, x + dimc.width(), labelfont);
+ pi.change.paintCue(pi, x, y, x + dimc.width(), labelfont);
} else {
view_[&bv].button_dim_.x1 = 0;
view_[&bv].button_dim_.y1 = 0;
}
// Do not draw the cue for INSERTED -- it is already in the button and
// that's enough.
- Changer cdummy = (pi.change_.type == Change::INSERTED)
- ? make_change(pi.change_, Change())
+ Changer cdummy = (pi.change.type == Change::INSERTED)
+ ? make_change(pi.change, Change())
: Changer();
InsetText::draw(pi, textx, texty);
break;
// We will take care of the frame and the change tracking cue
// ourselves, below.
{
- Changer cdummy = make_change(pi.change_, Change());
+ Changer cdummy = make_change(pi.change, Change());
const_cast<InsetCollapsible *>(this)->setDrawFrame(false);
InsetText::draw(pi, textx, texty);
const_cast<InsetCollapsible *>(this)->setDrawFrame(true);
desc -= 3;
// Colour the frame according to the change type. (Like for tables.)
- Color colour = pi.change_.changed() ? pi.change_.color()
+ Color colour = pi.change.changed() ? pi.change.color()
: Color_foreground;
const int xx1 = x + TEXT_TO_INSET_OFFSET - 1;
const int xx2 = x + textdim.wid - TEXT_TO_INSET_OFFSET + 1;
// the label below the text. Can be toggled.
if (g == SubLabel) {
FontInfo font(getLabelfont());
- if (pi.change_.changed())
+ if (pi.change.changed())
font.setPaintColor(colour);
font.realize(sane_font);
font.decSize();
}
// Strike through the inset if deleted and not already handled by
// RowPainter.
- if (pi.change_.deleted() && canPaintChange(bv))
- pi.change_.paintCue(pi, xx1, y1, xx2, y + desc);
+ if (pi.change.deleted() && canPaintChange(bv))
+ pi.change.paintCue(pi, xx1, y1, xx2, y + desc);
break;
}
}
pos_type const n = min(max_length, p_siz);
pos_type i = 0;
pos_type j = 0;
- bool changed_content = false;
for (; i < n && j < p_siz; ++j) {
- if (paragraphs().begin()->isChanged(j)) {
- changed_content = true;
- if (paragraphs().begin()->isDeleted(j))
- continue;
- }
+ if (paragraphs().begin()->isDeleted(j))
+ continue;
if (paragraphs().begin()->isInset(j)) {
if (!paragraphs().begin()->getInset(j)->isChar())
continue;
if (paragraphs().size() > 1 || (i > 0 && j < p_siz)) {
label << "...";
}
- docstring lbl;
- // indicate changed content in label (#8645)
- if (changed_content)
- lbl = char_type(0x270E);// ✎ U+270E LOWER RIGHT PENCIL
- lbl += label.str();
- return lbl.empty() ? l : lbl;
+ return label.str().empty() ? l : label.str();
}
docstring const InsetCollapsible::buttonLabel(BufferView const & bv) const
{
+ // indicate changed content in label (#8645)
+ // ✎ U+270E LOWER RIGHT PENCIL
+ docstring const indicator = (isChanged() && geometry(bv) == ButtonOnly)
+ ? docstring(1, 0x270E) : docstring();
InsetLayout const & il = getLayout();
docstring const label = getLabel();
if (!il.contentaslabel() || geometry(bv) != ButtonOnly)
- return label;
- return getNewLabel(label);
+ return indicator + label;
+ return indicator + getNewLabel(label);
}