From: Vincent van Ravesteijn Date: Thu, 17 Dec 2009 15:21:08 +0000 (+0000) Subject: Do not hardcode the background color of the preview at two places. X-Git-Tag: 2.0.0~4786 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5a530cca94e8f4842200c671c320940ebf36e541;p=features.git Do not hardcode the background color of the preview at two places. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32562 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index 453f36c91a..58fb336294 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -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()); diff --git a/src/graphics/PreviewLoader.h b/src/graphics/PreviewLoader.h index 0227466f7d..980c757444 100644 --- a/src/graphics/PreviewLoader.h +++ b/src/graphics/PreviewLoader.h @@ -20,6 +20,7 @@ #include +#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 diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 6c429c945a..57137db2f2 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -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; }