The branch, master, has been updated.

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

commit df7f2a074fe062de0033d0ba16bd05e4a4b79eb0
Author: Juergen Spitzmueller <[email protected]>
Date:   Sun Dec 2 10:41:49 2012 +0100

    Fix greyedout notes UI color (#6682) as good as it gets ATM

diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index b18bf79..51c3d41 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -815,6 +815,7 @@ string BufferParams::readToken(Lexer & lex, string const & 
token,
                lex.eatLine();
                string color = lex.getString();
                notefontcolor = lyx::rgbFromHexName(color);
+               lcolor.setColor("notefontcolor", color);
        } else if (token == "\\boxbgcolor") {
                lex.eatLine();
                string color = lex.getString();
diff --git a/src/insets/InsetNote.cpp b/src/insets/InsetNote.cpp
index 9b4ba57..874a6aa 100644
--- a/src/insets/InsetNote.cpp
+++ b/src/insets/InsetNote.cpp
@@ -18,6 +18,7 @@
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "BufferParams.h"
+#include "ColorSet.h"
 #include "Counters.h"
 #include "Cursor.h"
 #include "DispatchResult.h"
@@ -336,6 +337,19 @@ bool InsetNote::allowSpellCheck() const
        return (params_.type == InsetNoteParams::Greyedout || 
lyxrc.spellcheck_notes);
 }
 
+FontInfo InsetNote::getFont() const
+{
+       FontInfo font = getLayout().font();
+       // FIXME: This hardcoded color is a hack!
+       if (params_.type == InsetNoteParams::Greyedout
+           && buffer().params().notefontcolor != 
lyx::rgbFromHexName("#cccccc")) {
+               ColorCode c = lcolor.getFromLyXName("notefontcolor");
+               if (c != Color_none)
+                       font.setColor(c);
+       }
+       return font;
+}
+
 
 string InsetNote::params2string(InsetNoteParams const & params)
 {
diff --git a/src/insets/InsetNote.h b/src/insets/InsetNote.h
index dc7de0e..2deb84f 100644
--- a/src/insets/InsetNote.h
+++ b/src/insets/InsetNote.h
@@ -73,6 +73,8 @@ private:
        ///
        bool allowSpellCheck() const;
        ///
+       FontInfo getFont() const;
+       ///
        void write(std::ostream &) const;
        ///
        void read(Lexer & lex);

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

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


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to