Toc & toc = buffer().tocBackend().toc("branch");
docstring str = params_.branch + ": ";
text().forToc(str, TOC_ENTRY_LENGTH);
- toc.push_back(TocItem(pit, 0, str, toolTipText()));
+ toc.push_back(TocItem(pit, 0, str, toolTipText(docstring(), 3, 60)));
// Proceed with the rest of the inset.
InsetCollapsable::addToToc(cpit);
}
Toc & toc = buffer().tocBackend().toc("footnote");
docstring str = custom_label_ + ": ";
text().forToc(str, TOC_ENTRY_LENGTH);
- toc.push_back(TocItem(pit, 0, str, toolTipText()));
+ toc.push_back(TocItem(pit, 0, str, toolTipText(docstring(), 3, 60)));
// Proceed with the rest of the inset.
InsetFootlike::addToToc(cpit);
}
Toc & toc = buffer().tocBackend().toc("marginalnote");
docstring str;
text().forToc(str, TOC_ENTRY_LENGTH);
- toc.push_back(TocItem(pit, 0, str, toolTipText()));
+ toc.push_back(TocItem(pit, 0, str, toolTipText(docstring(), 3, 60)));
// Proceed with the rest of the inset.
InsetFootlike::addToToc(cpit);
}
InsetLayout const & il = getLayout();
docstring str = translateIfPossible(il.labelstring()) + from_ascii(": ");
text().forToc(str, TOC_ENTRY_LENGTH);
- toc.push_back(TocItem(pit, 0, str, toolTipText()));
+ toc.push_back(TocItem(pit, 0, str, toolTipText(docstring(), 3, 60)));
// Proceed with the rest of the inset.
InsetCollapsable::addToToc(cpit);
}
}
-docstring InsetText::toolTipText(docstring prefix) const
+docstring InsetText::toolTipText(docstring prefix,
+ size_t numlines, size_t len) const
{
- static unsigned int max_length = 400; // five 80 column lines
+ size_t const max_length = numlines * len;
OutputParams rp(&buffer().params().encoding());
odocstringstream oss;
oss << prefix;
if (str.length() > max_length)
break;
}
- return support::wrapParas(str, 4, 80, 5);
+ return support::wrapParas(str, 4, len, numlines);
}
/// returns the text to be used as tooltip
/// \param prefix: a string that will preced the tooltip,
/// e.g., "Index: ".
- docstring toolTipText(docstring prefix = empty_docstring()) const;
+ /// \param numlines: the number of lines in the tooltip
+ /// \param len: length of those lines
+ docstring toolTipText(docstring prefix = empty_docstring(),
+ size_t numlines = 5, size_t len = 80) const;
///
docstring contextMenu(BufferView const &, int, int) const;