Commit a1d4b63f authored by Alessandro Portale's avatar Alessandro Portale

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's avatarNikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Ivan Donchevskii's avatarIvan Donchevskii <ivan.donchevskii@qt.io>
parent be42d40c
......@@ -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>
......
......@@ -6017,6 +6017,55 @@
id="rect5183-16"
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
<g
id="src/libs/cplusplus/images/property"
transform="translate(292)">
<rect
y="552"
x="133"
height="16"
width="16"
id="rect4853-2"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-opacity:1" />
<path
style="fill:#000000"
d="m 143.5,563 c 1,-2 3.5,-2 4.5,0 h -2.5 l -1,1 1,1 h 2.5 c -1,2 -3.5,2 -4.5,0"
id="path5959"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" />
<rect
style="fill:#000000"
id="rect5867"
width="7.5"
height="2"
x="137"
y="563"
rx="1" />
</g>
<g
id="src/libs/cplusplus/images/propertybackground">
<rect
y="552"
x="441"
height="16"
width="16"
id="rect4853-7-5"
style="fill:#ffffff" />
<rect
style="fill:#000000"
id="rect5979"
width="8.5"
height="4"
x="444"
y="562"
rx="2" />
<circle
style="fill:#000000"
id="path5981"
cx="453.5"
cy="564"
r="3.5" />
</g>
</g>
<g
inkscape:groupmode="layer"
......
Markdown is supported
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