* InsetIndex.{cpp,h}:

- add index name to button label (part of #6455).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33074 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2010-01-17 14:47:45 +00:00
parent 906e8a9b8b
commit 9a63a02956
2 changed files with 25 additions and 0 deletions

View File

@ -287,6 +287,29 @@ docstring InsetIndex::toolTip(BufferView const &, int, int) const
}
docstring const InsetIndex::buttonLabel(BufferView const & bv) const
{
InsetLayout const & il = getLayout();
docstring label = translateIfPossible(il.labelstring());
if (buffer().params().use_indices && !params_.index.empty()) {
Buffer const & realbuffer = *buffer().masterBuffer();
IndicesList const & indiceslist = realbuffer.params().indiceslist();
label += " (";
Index const * index = indiceslist.findShortcut(params_.index);
if (!index)
label += _("unknown type!");
else
label += index->index();
label += ")";
}
if (!il.contentaslabel() || geometry(bv) != ButtonOnly)
return label;
return getNewLabel(label);
}
void InsetIndex::write(ostream & os) const
{
os << to_utf8(name());

View File

@ -74,6 +74,8 @@ private:
void addToToc(DocIterator const &);
///
docstring toolTip(BufferView const & bv, int x, int y) const;
///
docstring const buttonLabel(BufferView const & bv) const;
/// Updates needed features for this inset.
void validate(LaTeXFeatures & features) const;
///