mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-30 05:12:40 +00:00
* 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:
parent
906e8a9b8b
commit
9a63a02956
@ -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());
|
||||
|
@ -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;
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user