#include "Lexer.h"
#include "MetricsInfo.h"
#include "OutputParams.h"
+#include "TextClass.h"
#include "frontends/FontMetrics.h"
#include "frontends/Painter.h"
bool InsetCollapsable::setMouseHover(BufferView const * bv, bool mouse_hover)
+ const
{
mouse_hover_[bv] = mouse_hover;
return true;
const int xx2 = x + textdim.wid - TEXT_TO_INSET_OFFSET + 1;
pi.pain.line(xx1, y + desc - 4,
xx1, y + desc,
- labelColor());
+ Color_foreground);
if (status_ == Open)
pi.pain.line(xx1, y + desc,
xx2, y + desc,
- labelColor());
+ Color_foreground);
else {
// Make status_ value visible:
pi.pain.line(xx1, y + desc,
xx1 + 4, y + desc,
- labelColor());
+ Color_foreground);
pi.pain.line(xx2 - 4, y + desc,
xx2, y + desc,
- labelColor());
+ Color_foreground);
}
pi.pain.line(x + textdim.wid - 3, y + desc, x + textdim.wid - 3,
- y + desc - 4, labelColor());
+ y + desc - 4, Color_foreground);
// the label below the text. Can be toggled.
if (geometry(bv) == SubLabel) {
if (cur.isInside(this)) {
y -= textdim.asc;
y += 3;
- pi.pain.line(xx1, y + 4, xx1, y, labelColor());
- pi.pain.line(xx1 + 4, y, xx1, y, labelColor());
- pi.pain.line(xx2, y + 4, xx2, y,
- labelColor());
- pi.pain.line(xx2 - 4, y, xx2, y,
- labelColor());
+ pi.pain.line(xx1, y + 4, xx1, y, Color_foreground);
+ pi.pain.line(xx1 + 4, y, xx1, y, Color_foreground);
+ pi.pain.line(xx2, y + 4, xx2, y, Color_foreground);
+ pi.pain.line(xx2 - 4, y, xx2, y, Color_foreground);
}
break;
}
}
+bool InsetCollapsable::clickable(int x, int y) const
+{
+ FuncRequest cmd(LFUN_NOACTION, x, y, mouse_button::none);
+ return hitButton(cmd);
+}
+
+
docstring const InsetCollapsable::getNewLabel(docstring const & l) const
{
docstring label;
case mouse_button::button4:
case mouse_button::button5:
// Nothing to do.
- cur.noUpdate();
+ cur.noScreenUpdate();
break;
}
} else if (geometry(cur.bv()) != ButtonOnly)
case LFUN_MOUSE_DOUBLE:
case LFUN_MOUSE_TRIPLE:
if (hitButton(cmd))
- cur.noUpdate();
+ cur.noScreenUpdate();
else if (geometry(cur.bv()) != ButtonOnly)
InsetText::doDispatch(cur, cmd);
else
}
if (cmd.button() != mouse_button::button1) {
// Nothing to do.
- cur.noUpdate();
+ cur.noScreenUpdate();
break;
}
// if we are selecting, we do not want to
// Left button is clicked, the user asks to
// toggle the inset visual state.
cur.dispatched();
- cur.updateFlags(Update::Force | Update::FitCursor);
+ cur.screenUpdateFlags(Update::Force | Update::FitCursor);
if (geometry(cur.bv()) == ButtonOnly) {
setStatus(cur, Open);
edit(cur, true);
{
status_ = status;
setButtonLabel();
- if (status_ == Collapsed) {
+ if (status_ == Collapsed)
cur.leaveInset(*this);
- mouse_hover_.clear();
- }
}