mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Fix greyedout notes UI color (#6682) as good as it gets ATM
This commit is contained in:
parent
2b40823d8e
commit
df7f2a074f
@ -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();
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -73,6 +73,8 @@ private:
|
||||
///
|
||||
bool allowSpellCheck() const;
|
||||
///
|
||||
FontInfo getFont() const;
|
||||
///
|
||||
void write(std::ostream &) const;
|
||||
///
|
||||
void read(Lexer & lex);
|
||||
|
Loading…
Reference in New Issue
Block a user