forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user