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

This commit is contained in:
Juergen Spitzmueller 2012-12-02 10:41:49 +01:00
parent 2b40823d8e
commit df7f2a074f
3 changed files with 17 additions and 0 deletions

View 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();

View 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)
{

View File

@ -73,6 +73,8 @@ private:
///
bool allowSpellCheck() const;
///
FontInfo getFont() const;
///
void write(std::ostream &) const;
///
void read(Lexer & lex);