mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
Simplify some of the tooltip stuff now.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36346 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
7d0b98a858
commit
4133f627b2
@ -288,11 +288,7 @@ docstring InsetIndex::toolTip(BufferView const &, int, int) const
|
||||
tip += ")";
|
||||
}
|
||||
tip += ": ";
|
||||
OutputParams rp(&buffer().params().encoding());
|
||||
odocstringstream ods;
|
||||
InsetText::plaintext(ods, rp);
|
||||
tip += ods.str();
|
||||
return wrapParas(tip);
|
||||
return InsetText::toolTipText(tip);
|
||||
}
|
||||
|
||||
|
||||
|
@ -299,13 +299,10 @@ bool InsetPhantom::getStatus(Cursor & cur, FuncRequest const & cmd,
|
||||
|
||||
docstring InsetPhantom::toolTip(BufferView const &, int, int) const
|
||||
{
|
||||
OutputParams rp(&buffer().params().encoding());
|
||||
odocstringstream ods;
|
||||
InsetCollapsable::plaintext(ods, rp);
|
||||
docstring content_tip = support::wrapParas(ods.str());
|
||||
docstring const tip = InsetText::toolTipText();
|
||||
docstring res = phantomtranslator_loc().find(params_.type);
|
||||
if (!content_tip.empty())
|
||||
res += from_ascii(": ") + "\n" + content_tip;
|
||||
if (!tip.empty())
|
||||
res += from_ascii(": ") + "\n" + tip;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -820,11 +820,12 @@ docstring InsetText::contextMenu(BufferView const &, int, int) const
|
||||
}
|
||||
|
||||
|
||||
docstring InsetText::toolTipText() const
|
||||
docstring InsetText::toolTipText(docstring prefix) const
|
||||
{
|
||||
static unsigned int max_length = 400; // five 80 column lines
|
||||
OutputParams rp(&buffer().params().encoding());
|
||||
odocstringstream oss;
|
||||
oss << prefix;
|
||||
|
||||
ParagraphList::const_iterator beg = paragraphs().begin();
|
||||
ParagraphList::const_iterator end = paragraphs().end();
|
||||
|
@ -191,7 +191,9 @@ public:
|
||||
///
|
||||
void completionPosAndDim(Cursor const &, int & x, int & y, Dimension & dim) const;
|
||||
/// returns the text to be used as tooltip
|
||||
docstring toolTipText() const;
|
||||
/// \param prefix: a string that will preced the tooltip,
|
||||
/// e.g., "Index: ".
|
||||
docstring toolTipText(docstring prefix = from_ascii("")) const;
|
||||
|
||||
///
|
||||
virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
|
||||
|
Loading…
Reference in New Issue
Block a user