]> git.lyx.org Git - features.git/commitdiff
Now the coloured box around the regexp is visible also if InsetPreview is enabled.
authorTommaso Cucinotta <tommaso@lyx.org>
Fri, 5 Feb 2010 18:34:01 +0000 (18:34 +0000)
committerTommaso Cucinotta <tommaso@lyx.org>
Fri, 5 Feb 2010 18:34:01 +0000 (18:34 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33336 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathHull.cpp

index f1891a1564491eda68e532ff7724317798dda2e3..f674fa017faf9499b1971cf6567e22fbfe97ab9f 100644 (file)
@@ -22,6 +22,7 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "BufferView.h"
+#include "ColorSet.h"
 #include "CutAndPaste.h"
 #include "Encoding.h"
 #include "FuncRequest.h"
@@ -636,9 +637,15 @@ void InsetMathHull::validate(LaTeXFeatures & features) const
        if (ams())
                features.require("amsmath");
 
-       if (type_ == hullRegexp)
+       if (type_ == hullRegexp) {
+               features.require("color");
+               string frcol = lcolor.getLaTeXName(Color_regexpframe);
+               string bgcol = "white";
                features.addPreambleSnippet(
-                       "\\newcommand{\\regexp}[1]{\\fbox{\\texttt{#1}}}");
+                       string("\\newcommand{\\regexp}[1]{\\fcolorbox{")
+                       + frcol + string("}{")
+                       + bgcol + string("}{\\texttt{#1}}}"));
+       }
 
        // Validation is necessary only if not using AMS math.
        // To be safe, we will always run mathedvalidate.