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 |
@@ -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"
|
||||
|
||||
|
Before Width: | Height: | Size: 306 KiB After Width: | Height: | Size: 307 KiB |
Reference in New Issue
Block a user