]> git.lyx.org Git - features.git/commitdiff
Fix greyedout notes UI color (#6682) as good as it gets ATM
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 2 Dec 2012 09:41:49 +0000 (10:41 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 2 Dec 2012 09:41:49 +0000 (10:41 +0100)
src/BufferParams.cpp
src/insets/InsetNote.cpp
src/insets/InsetNote.h

index b18bf79602ff57b2d8fb4f5206558f246fd72e59..51c3d410af64471cbaa0e65079368f07c9977df7 100644 (file)
@@ -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();
index 9b4ba5768d42407f9dd5da5d63be85b67b9bf13d..874a6aaf1a0aa64b9b0948b8ba08bd1b08264a35 100644 (file)
@@ -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)
 {
index dc7de0e3f3e2369a4bce6d82e10c9f5d75c7c512..2deb84f0f8b272047e5721a8bb7d50b76fec26fb 100644 (file)
@@ -73,6 +73,8 @@ private:
        ///
        bool allowSpellCheck() const;
        ///
+       FontInfo getFont() const;
+       ///
        void write(std::ostream &) const;
        ///
        void read(Lexer & lex);