The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit ee0860e403d144308b1cdcb0ef223bc34008c64b
Author: Juergen Spitzmueller <[email protected]>
Date:   Fri Nov 30 17:11:07 2012 +0100

    Fix shaded box UI color (#7395) as good as it gets ATM

diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index 403a2cb..b18bf79 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -819,6 +819,7 @@ string BufferParams::readToken(Lexer & lex, string const & 
token,
                lex.eatLine();
                string color = lex.getString();
                boxbgcolor = lyx::rgbFromHexName(color);
+               lcolor.setColor("boxbgcolor", color);
        } else if (token == "\\paperwidth") {
                lex >> paperwidth;
        } else if (token == "\\paperheight") {
diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp
index 2e611ff..f55abcd 100644
--- a/src/insets/InsetBox.cpp
+++ b/src/insets/InsetBox.cpp
@@ -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()) {
diff --git a/src/insets/InsetBox.h b/src/insets/InsetBox.h
index 236525e..cf0f689 100644
--- a/src/insets/InsetBox.h
+++ b/src/insets/InsetBox.h
@@ -102,6 +102,8 @@ public:
        ///
        DisplayType display() const { return Inline; }
        ///
+       ColorCode backgroundColor(PainterInfo const &) const;
+       ///
        bool allowParagraphCustomization(idx_type = 0) const { return 
!forcePlainLayout(); }
        ///
        bool forcePlainLayout(idx_type = 0) const;

-----------------------------------------------------------------------

Summary of changes:
 src/BufferParams.cpp    |    1 +
 src/insets/InsetBox.cpp |   15 +++++++++++++++
 src/insets/InsetBox.h   |    2 ++
 3 files changed, 18 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to