]> git.lyx.org Git - features.git/commitdiff
Allow customization of label string for note insets. We actually had
authorRichard Heck <rgheck@comcast.net>
Tue, 14 Dec 2010 23:16:19 +0000 (23:16 +0000)
committerRichard Heck <rgheck@comcast.net>
Tue, 14 Dec 2010 23:16:19 +0000 (23:16 +0000)
strings in the layout file, but they were not used.

Question: Should we just remove InsetNote::setButtonLabel() now? The
only purpose it is serving is to provide a backup in case no label is
defined.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36884 a592a061-630c-0410-9148-cb99ea01b6c8

lib/layouts/stdinsets.inc
src/insets/InsetNote.cpp

index f2443a902b2f39b9a53240f6267e4e4b5b3a4e44..58e19a358c30424f00e8829e9bacbb80ecb7750c 100644 (file)
@@ -77,7 +77,7 @@ InsetLayout Foot
 End
 
 InsetLayout Note:Comment
-       LabelString           comment
+       LabelString           Comment
        LatexType             environment
        LatexName             comment
        BgColor               commentbg
@@ -92,7 +92,7 @@ End
 
 
 InsetLayout Note:Note
-       LabelString           note
+       LabelString           Note
        LatexType             command
        LatexName             note
        BgColor               notebg
@@ -107,7 +107,7 @@ End
 
 
 InsetLayout Note:Greyedout
-       LabelString           greyedout
+       LabelString           Greyedout
        LatexType             environment
        LatexName             lyxgreyedout
        BgColor               greyedoutbg
index 5198524da64218c07af50a6603993f9e04b223a1..1ab8edd95ab6a369dcbc8a7859663df82679a5f4 100644 (file)
@@ -156,7 +156,11 @@ void InsetNote::read(Lexer & lex)
 
 void InsetNote::setButtonLabel()
 {
-       docstring const label = notetranslator_loc().find(params_.type);
+       docstring label = getLayout().labelstring();
+       if (label.empty())
+               label = notetranslator_loc().find(params_.type);
+       else
+               label = translateIfPossible(label);
        setLabel(label);
 }