]> git.lyx.org Git - features.git/commitdiff
Do not hardcode the background color of the preview at two places.
authorVincent van Ravesteijn <vfr@lyx.org>
Thu, 17 Dec 2009 15:21:08 +0000 (15:21 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Thu, 17 Dec 2009 15:21:08 +0000 (15:21 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32562 a592a061-630c-0410-9148-cb99ea01b6c8

src/graphics/PreviewLoader.cpp
src/graphics/PreviewLoader.h
src/mathed/InsetMathHull.cpp

index 453f36c91ac235ca8e8b62bbf432655d8c646709..58fb336294a355a03b9e664450ff30efa486ff8a 100644 (file)
@@ -595,8 +595,8 @@ void PreviewLoader::Impl::startLoading()
        cs << pconverter_->command << ' ' << pconverter_->to << ' '
           << quoteName(latexfile.toFilesystemEncoding()) << ' '
           << int(font_scaling_factor_) << ' '
-          << theApp()->hexName(Color_preview) << ' '
-          << theApp()->hexName(Color_background);
+          << theApp()->hexName(PreviewLoader::foregroundColor()) << ' '
+          << theApp()->hexName(PreviewLoader::backgroundColor());
 
        string const command = libScriptSearch(cs.str());
 
index 0227466f7da4b3da4d6d00445ed1bbf0e2c07e2b..980c757444f5b2b7ef0873d531038beb243621cf 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <boost/signal.hpp>
 
+#include "ColorCode.h"
 
 namespace lyx {
 
@@ -85,6 +86,10 @@ public:
 
        /// Which buffer owns this loader.
        Buffer const & buffer() const;
+       /// The background color used
+       static ColorCode backgroundColor() { return Color_background; }
+       /// The foreground color used
+       static ColorCode foregroundColor() { return Color_preview; }
 
 private:
        /// noncopyable
index 6c429c945ab5fa59b86d4acce94542cf0ad5578f..57137db2f2d1ea286e6cc2cbd5a498640e36b906 100644 (file)
@@ -39,6 +39,7 @@
 #include "insets/RenderPreview.h"
 
 #include "graphics/PreviewImage.h"
+#include "graphics/PreviewLoader.h"
 
 #include "frontends/Painter.h"
 
@@ -373,7 +374,7 @@ void InsetMathHull::metrics(MetricsInfo & mi, Dimension & dim) const
 ColorCode InsetMathHull::backgroundColor(PainterInfo const & pi) const
 {
        if (previewState(pi.base.bv))
-               return Color_background;
+               return graphics::PreviewLoader::backgroundColor();
        return Color_mathbg;
 }