#include "frontends/FontMetrics.h"
#include "frontends/Painter.h"
-#include "support/assert.h"
+#include "support/lassert.h"
#include "support/debug.h"
#include "support/docstream.h"
#include "support/gettext.h"
if (x > xo(bv) + dim.wid || y > yo(bv) + dim.des)
return docstring();
+ docstring default_tip;
switch (status_) {
case Open:
- return _("Left-click to collapse the inset");
+ default_tip = _("Left-click to collapse the inset");
+ break;
case Collapsed:
- return _("Left-click to open the inset");
+ default_tip = _("Left-click to open the inset");
+ break;
}
- return docstring();
+
+ OutputParams rp(&buffer().params().encoding());
+ odocstringstream ods;
+ InsetText::plaintext(ods, rp);
+ docstring content_tip = ods.str();
+ // shorten it if necessary
+ if (content_tip.size() > 200)
+ content_tip = content_tip.substr(0, 200) + "...";
+ if (!isOpen() && !content_tip.empty())
+ return content_tip + '\n' + default_tip;
+ return default_tip;
}
case LFUN_ACCENT_HUNGARIAN_UMLAUT:
case LFUN_ACCENT_MACRON:
case LFUN_ACCENT_OGONEK:
- case LFUN_ACCENT_SPECIAL_CARON:
case LFUN_ACCENT_TIE:
case LFUN_ACCENT_TILDE:
case LFUN_ACCENT_UMLAUT:
{
status_ = status;
setButtonLabel();
- if (status_ == Collapsed)
+ if (status_ == Collapsed) {
cur.leaveInset(*this);
+ mouse_hover_ = false;
+ }
}