CPlusPlus: Add a property icon

Properties have been so useful in Qt for Years, and they will
continue being so. Properties deserve a proper icon.

Change-Id: Ifd19c97470a48a033bbe4017855f7b150befb365
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Alessandro Portale
2017-06-12 18:27:57 +02:00
parent be42d40c44
commit a1d4b63f8d
8 changed files with 66 additions and 0 deletions

View File

@@ -107,6 +107,8 @@ Icons::IconType Icons::iconTypeForSymbol(const Symbol *symbol)
return NamespaceIconType;
} else if (symbol->isTypenameArgument()) {
return ClassIconType;
} else if (symbol->isQtPropertyDeclaration() || symbol->isObjCPropertyDeclaration()) {
return PropertyIconType;
} else if (symbol->isUsingNamespaceDirective() ||
symbol->isUsingDeclaration()) {
// TODO: Might be nice to have a different icons for these things
@@ -136,6 +138,10 @@ QIcon Icons::iconForType(IconType type)
QLatin1String(":/codemodel/images/signal.png"), Theme::IconsCodeModelFunctionColor};
static const IconMaskAndColor slotIcon {
QLatin1String(":/codemodel/images/slot.png"), Theme::IconsCodeModelFunctionColor};
static const IconMaskAndColor propertyIcon {
QLatin1String(":/codemodel/images/property.png"), Theme::IconsCodeModelOverlayForegroundColor};
static const IconMaskAndColor propertyBackgroundIcon {
QLatin1String(":/codemodel/images/propertybackground.png"), Theme::IconsCodeModelOverlayBackgroundColor};
static const IconMaskAndColor protectedIcon {
QLatin1String(":/codemodel/images/protected.png"), Theme::IconsCodeModelOverlayForegroundColor};
static const IconMaskAndColor protectedBackgroundIcon {
@@ -291,6 +297,12 @@ QIcon Icons::iconForType(IconType type)
}, Icon::Tint).icon());
return icon;
}
case PropertyIconType: {
const static QIcon icon(Icon({
variableIcon, propertyBackgroundIcon, propertyIcon
}, Icon::Tint).icon());
return icon;
}
default:
break;
}