]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetNote.cpp
Prevent more local colors from leaking (#6626)
[features.git] / src / insets / InsetNote.cpp
index 6108b838a66a98c5002ba74d53c7979d27bd3dd5..adacef3bae267066beec930dacb5f5b707ca6f65 100644 (file)
 #include "BufferView.h"
 #include "ColorSet.h"
 #include "Cursor.h"
-#include "DispatchResult.h"
 #include "Exporter.h"
+#include "FontInfo.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
+#include "InsetLayout.h"
 #include "LaTeXFeatures.h"
 #include "Lexer.h"
 #include "LyXRC.h"
 #include "output_docbook.h"
-#include "TextClass.h"
-#include "TocBackend.h"
 
 #include "support/debug.h"
 #include "support/docstream.h"
@@ -328,12 +327,15 @@ bool InsetNote::allowSpellCheck() const
 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")) {
+           && buffer().params().isnotefontcolor) {
                ColorCode c = lcolor.getFromLyXName("notefontcolor");
                if (c != Color_none)
                        font.setColor(c);
+               // This is the local color (not overridden by other documents)
+               ColorCode lc = lcolor.getFromLyXName("notefontcolor@" + buffer().fileName().absFileName());
+               if (lc != Color_none)
+                       font.setPaintColor(lc);
        }
        return font;
 }