]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBox.cpp
Math.lyx, Tutorial.lyx: fix some typos spotted by a user
[lyx.git] / src / insets / InsetBox.cpp
index 2e611ffd30d14e818c78b09952a59a8bc7155d6b..f55abcdfa1e0b1cc7d5138c97d7dc1bf914d1b15 100644 (file)
@@ -17,6 +17,7 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "BufferView.h"
+#include "ColorSet.h"
 #include "Cursor.h"
 #include "DispatchResult.h"
 #include "FuncStatus.h"
@@ -184,6 +185,20 @@ bool InsetBox::forcePlainLayout(idx_type) const
 }
 
 
+ColorCode InsetBox::backgroundColor(PainterInfo const &) const
+{
+       if (params_.type != "Shaded")
+               return getLayout().bgcolor();
+       // FIXME: This hardcoded color is a hack!
+       if (buffer().params().boxbgcolor == lyx::rgbFromHexName("#ff0000"))
+               return getLayout().bgcolor();
+       ColorCode c = lcolor.getFromLyXName("boxbgcolor");
+       if (c == Color_none)
+               return getLayout().bgcolor();
+       return c;
+}
+
+
 void InsetBox::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
        switch (cmd.action()) {