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;
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ public:
|
||||
SlotPrivateIconType,
|
||||
KeywordIconType,
|
||||
MacroIconType,
|
||||
PropertyIconType,
|
||||
UnknownIconType
|
||||
};
|
||||
|
||||
|
||||
@@ -18,6 +18,10 @@
|
||||
<file>images/private@2x.png</file>
|
||||
<file>images/privatebackground.png</file>
|
||||
<file>images/privatebackground@2x.png</file>
|
||||
<file>images/property.png</file>
|
||||
<file>images/property@2x.png</file>
|
||||
<file>images/propertybackground.png</file>
|
||||
<file>images/propertybackground@2x.png</file>
|
||||
<file>images/protected.png</file>
|
||||
<file>images/protected@2x.png</file>
|
||||
<file>images/protectedbackground.png</file>
|
||||
|
||||
BIN
src/libs/cplusplus/images/property.png
Normal file
BIN
src/libs/cplusplus/images/property.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 148 B |
BIN
src/libs/cplusplus/images/property@2x.png
Normal file
BIN
src/libs/cplusplus/images/property@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 133 B |
BIN
src/libs/cplusplus/images/propertybackground.png
Normal file
BIN
src/libs/cplusplus/images/propertybackground.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 131 B |
BIN
src/libs/cplusplus/images/propertybackground@2x.png
Normal file
BIN
src/libs/cplusplus/images/propertybackground@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 187 B |
Reference in New Issue
Block a user