Commit 0742a321 authored by Martin Seher's avatar Martin Seher Committed by Milian Wolff
Browse files

Introduce separate colors for local/inherited member functions

While for now the colors are the same as those used for member
variables, in the future these can be made configurable then.
parent 25c84e56
......@@ -405,10 +405,19 @@ CodeHighlightingType CodeHighlightingInstance::typeForDeclaration(Declaration* d
//Determine the class we're in
Declaration* klass = localClassFromCodeContext(context);
if (klass) {
if (klass->internalContext() == dec->context())
type = CodeHighlightingType::LocalClassMember; // Using Member of the local class
else if (klass->internalContext() && klass->internalContext()->imports(dec->context()))
type = CodeHighlightingType::InheritedClassMember; // Using Member of an inherited class
if (klass->internalContext() == dec->context()) {
// Using Member of the local class
if (dec->type<KDevelop::FunctionType>())
type = CodeHighlightingType::LocalMemberFunction;
else
type = CodeHighlightingType::LocalClassMember;
} else if (klass->internalContext() && klass->internalContext()->imports(dec->context())) {
// Using Member of an inherited clas
if (dec->type<KDevelop::FunctionType>())
type = CodeHighlightingType::InheritedMemberFunction;
else
type = CodeHighlightingType::InheritedClassMember;
}
}
}
......
......@@ -33,7 +33,9 @@ enum class CodeHighlightingType {
Unknown,
// Primary highlighting:
LocalClassMember,
LocalMemberFunction,
InheritedClassMember,
InheritedMemberFunction,
LocalVariable,
// Other highlighting:
......
......@@ -45,7 +45,9 @@ void ConfigurableHighlightingColors::reset(ColorCache* cache)
addColor(CodeHighlightingType::Function, 0x21005A); // Navy blue
addColor(CodeHighlightingType::MemberVariable, 0x443069); // Dark Burple (blue/purple)
addColor(CodeHighlightingType::LocalClassMember, 0xae7d00); // Light orange
addColor(CodeHighlightingType::LocalMemberFunction, 0xae7d00);
addColor(CodeHighlightingType::InheritedClassMember, 0x705000); // Dark orange
addColor(CodeHighlightingType::InheritedMemberFunction, 0x705000);
addColor(CodeHighlightingType::LocalVariable, 0x0C4D3C);
addColor(CodeHighlightingType::FunctionVariable, 0x300085); // Less dark navy blue
addColor(CodeHighlightingType::NamespaceVariable, 0x9F3C5F); // Rose
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment