From: Juergen Spitzmueller Date: Sun, 2 Dec 2012 09:41:49 +0000 (+0100) Subject: Fix greyedout notes UI color (#6682) as good as it gets ATM X-Git-Tag: 2.1.0beta1~1164 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=df7f2a074fe062de0033d0ba16bd05e4a4b79eb0;p=features.git Fix greyedout notes UI color (#6682) as good as it gets ATM --- diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index b18bf79602..51c3d410af 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 9b4ba5768d..874a6aaf1a 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 dc7de0e3f3..2deb84f0f8 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);