]> git.lyx.org Git - features.git/commitdiff
Do not hardcode required packages for Note inset
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 21 Sep 2016 14:11:53 +0000 (16:11 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 21 Sep 2016 14:11:53 +0000 (16:11 +0200)
This does not change the default behavior, but allows to customize it.

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

index c5bf68df38e665b813d3884a31644c1ae50daf09..06ab62c4980df29c399a90c752d0b7544d4567b0 100644 (file)
@@ -115,6 +115,7 @@ InsetLayout Note:Comment
        LabelString           Comment
        LatexType             environment
        LatexName             comment
+       Requires              verbatim
        BgColor               commentbg
        LabelFont
          Color               comment
@@ -150,6 +151,7 @@ InsetLayout Note:Greyedout
        LabelString           Greyedout
        LatexType             environment
        LatexName             lyxgreyedout
+       Requires              color,lyxgreyedout
        BgColor               greyedoutbg
        Font
          Color               greyedouttext
index a2916fd921fa0fae9220273411fe0a33ac5a3e4e..d5e7fb324c5fc720bf6ae681c0740b115fab8059 100644 (file)
@@ -328,15 +328,15 @@ void InsetNote::validate(LaTeXFeatures & features) const
 {
        switch (params_.type) {
        case InsetNoteParams::Comment:
-               features.require("verbatim");
                if (features.runparams().flavor == OutputParams::HTML)
                        // we do output this but set display to "none" by default,
                        // but people might want to use it.
                        InsetCollapsable::validate(features);
+               else
+                       // Only do the requires
+                       features.useInsetLayout(getLayout());
                break;
        case InsetNoteParams::Greyedout:
-               features.require("color");
-               features.require("lyxgreyedout");
                InsetCollapsable::validate(features);
                break;
        case InsetNoteParams::Note: