]> 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>
Mon, 17 Oct 2016 08:22:45 +0000 (10:22 +0200)
This does not change the default behavior, but allows to customize it.

(cherry picked from commit db1270765573eafc453fe903fcfb6f9ba91f9f31)

lib/layouts/stdinsets.inc
src/insets/InsetNote.cpp
status.22x

index 7432b29069e54ce11b270044b150ef59ddea54c2..5d07e289a76dab0ecf72d72df167f94561c6326a 100644 (file)
@@ -115,6 +115,7 @@ InsetLayout Note:Comment
        LabelString           Comment
        LatexType             environment
        LatexName             comment
+       Requires              verbatim
        BgColor               commentbg
        LabelFont
          Color               comment
@@ -151,6 +152,7 @@ InsetLayout Note:Greyedout
        LabelString           Greyedout
        LatexType             environment
        LatexName             lyxgreyedout
+       Requires              color,lyxgreyedout
        BgColor               greyedoutbg
        Font
          Color               greyedouttext
index e483cf2e104a6ab9db38d223e843d362b3b97b03..3f422774c1215bf7f3c39abfd9fcb07a19196c7e 100644 (file)
@@ -329,15 +329,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:
index ea926585a75adb7e8333d897225179d0e6cf9047..acae4f6b17515273baa6e00d33b35848ace4e499 100644 (file)
@@ -36,6 +36,8 @@ What's new
 
 * DOCUMENT INPUT/OUTPUT
 
+- Do not hardcode required packages for Note inset.
+
 
 * LYX2LYX