Dimension dim = dimensionCollapsed();
if (geometry() == NoButton)
return translateIfPossible(layout_->labelstring());
- if (x > xo(bv) + dim.wid || y > yo(bv) + dim.des)
+ if (x > xo(bv) + dim.wid || y > yo(bv) + dim.des || isOpen())
return docstring();
- docstring default_tip;
- switch (status_) {
- case Open:
- default_tip = _("Left-click to collapse the inset");
- break;
- case Collapsed:
- default_tip = _("Left-click to open the inset");
- break;
- }
-
OutputParams rp(&buffer().params().encoding());
odocstringstream ods;
InsetText::plaintext(ods, rp);
// 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;
+ return content_tip;
}
docstring InsetFloat::toolTip(BufferView const & bv, int x, int y) const
{
- if (InsetCollapsable::toolTip(bv, x, y).empty())
+ if (InsetCollapsable::toolTip(bv, x, y).empty() || isOpen())
return docstring();
- docstring default_tip;
- if (isOpen())
- default_tip = _("Left-click to collapse the inset");
- else
- default_tip = _("Left-click to open the inset");
OutputParams rp(&buffer().params().encoding());
- docstring caption_tip = getCaptionText(rp);
- if (!isOpen() && !caption_tip.empty())
- return caption_tip + '\n' + default_tip;
- return default_tip;
+ return getCaptionText(rp);
}