From 398ad5a40a8d593a75f8e98df552bc49008dff88 Mon Sep 17 00:00:00 2001 From: Alexander Izmailov Date: Thu, 30 Oct 2014 19:43:48 +0300 Subject: [PATCH] Add icons for static fields and functions. Icons for static members in completion list now with S letter. Task-number: QTCREATORBUG-203 Change-Id: I6c997ad14eeb500936ffe73e2fc0ad8e552a46c9 Reviewed-by: Alessandro Portale --- src/libs/cplusplus/Icons.cpp | 37 ++++++++++++++++----- src/libs/cplusplus/Icons.h | 12 +++++++ src/libs/cplusplus/cplusplus.qrc | 8 ++++- src/libs/cplusplus/images/func_priv_st.png | Bin 0 -> 685 bytes src/libs/cplusplus/images/func_prot_st.png | Bin 0 -> 679 bytes src/libs/cplusplus/images/func_st.png | Bin 0 -> 651 bytes src/libs/cplusplus/images/static.png | Bin 0 -> 164 bytes src/libs/cplusplus/images/var_priv_st.png | Bin 0 -> 676 bytes src/libs/cplusplus/images/var_prot_st.png | Bin 0 -> 658 bytes src/libs/cplusplus/images/var_st.png | Bin 0 -> 629 bytes src/plugins/classview/classviewutils.cpp | 6 ++++ 11 files changed, 53 insertions(+), 10 deletions(-) create mode 100644 src/libs/cplusplus/images/func_priv_st.png create mode 100644 src/libs/cplusplus/images/func_prot_st.png create mode 100644 src/libs/cplusplus/images/func_st.png create mode 100644 src/libs/cplusplus/images/static.png create mode 100644 src/libs/cplusplus/images/var_priv_st.png create mode 100644 src/libs/cplusplus/images/var_prot_st.png create mode 100644 src/libs/cplusplus/images/var_st.png diff --git a/src/libs/cplusplus/Icons.cpp b/src/libs/cplusplus/Icons.cpp index 3d60574808f..1405b178e67 100644 --- a/src/libs/cplusplus/Icons.cpp +++ b/src/libs/cplusplus/Icons.cpp @@ -46,10 +46,16 @@ Icons::Icons() _funcPublicIcon(QLatin1String(":/codemodel/images/func.png")), _funcProtectedIcon(QLatin1String(":/codemodel/images/func_prot.png")), _funcPrivateIcon(QLatin1String(":/codemodel/images/func_priv.png")), + _funcPublicStaticIcon(QLatin1String(":/codemodel/images/func_st.png")), + _funcProtectedStaticIcon(QLatin1String(":/codemodel/images/func_prot_st.png")), + _funcPrivateStaticIcon(QLatin1String(":/codemodel/images/func_priv_st.png")), _namespaceIcon(QLatin1String(":/codemodel/images/namespace.png")), _varPublicIcon(QLatin1String(":/codemodel/images/var.png")), _varProtectedIcon(QLatin1String(":/codemodel/images/var_prot.png")), _varPrivateIcon(QLatin1String(":/codemodel/images/var_priv.png")), + _varPublicStaticIcon(QLatin1String(":/codemodel/images/var_st.png")), + _varProtectedStaticIcon(QLatin1String(":/codemodel/images/var_prot_st.png")), + _varPrivateStaticIcon(QLatin1String(":/codemodel/images/var_priv_st.png")), _signalIcon(QLatin1String(":/codemodel/images/signal.png")), _slotPublicIcon(QLatin1String(":/codemodel/images/slot.png")), _slotProtectedIcon(QLatin1String(":/codemodel/images/slot_prot.png")), @@ -99,21 +105,22 @@ Icons::IconType Icons::iconTypeForSymbol(const Symbol *symbol) } else if (function->isSignal()) { return SignalIconType; } else if (symbol->isPublic()) { - return FuncPublicIconType; + return symbol->isStatic() ? FuncPublicStaticIconType : FuncPublicIconType; } else if (symbol->isProtected()) { - return FuncProtectedIconType; + return symbol->isStatic() ? FuncProtectedStaticIconType : FuncProtectedIconType; } else if (symbol->isPrivate()) { - return FuncPrivateIconType; + return symbol->isStatic() ? FuncPrivateStaticIconType : FuncPrivateIconType; } } else if (symbol->enclosingScope() && symbol->enclosingScope()->isEnum()) { return EnumeratorIconType; } else if (symbol->isDeclaration() || symbol->isArgument()) { - if (symbol->isPublic()) - return VarPublicIconType; - else if (symbol->isProtected()) - return VarProtectedIconType; - else if (symbol->isPrivate()) - return VarPrivateIconType; + if (symbol->isPublic()) { + return symbol->isStatic() ? VarPublicStaticIconType : VarPublicIconType; + } else if (symbol->isProtected()) { + return symbol->isStatic() ? VarProtectedStaticIconType : VarProtectedIconType; + } else if (symbol->isPrivate()) { + return symbol->isStatic() ? VarPrivateStaticIconType : VarPrivateIconType; + } } else if (symbol->isEnum()) { return EnumIconType; } else if (symbol->isForwardClassDeclaration()) { @@ -156,6 +163,12 @@ QIcon Icons::iconForType(IconType type) const return _funcProtectedIcon; case FuncPrivateIconType: return _funcPrivateIcon; + case FuncPublicStaticIconType: + return _funcPublicStaticIcon; + case FuncProtectedStaticIconType: + return _funcProtectedStaticIcon; + case FuncPrivateStaticIconType: + return _funcPrivateStaticIcon; case NamespaceIconType: return _namespaceIcon; case VarPublicIconType: @@ -164,6 +177,12 @@ QIcon Icons::iconForType(IconType type) const return _varProtectedIcon; case VarPrivateIconType: return _varPrivateIcon; + case VarPublicStaticIconType: + return _varPublicStaticIcon; + case VarProtectedStaticIconType: + return _varProtectedStaticIcon; + case VarPrivateStaticIconType: + return _varPrivateStaticIcon; case SignalIconType: return _signalIcon; case SlotPublicIconType: diff --git a/src/libs/cplusplus/Icons.h b/src/libs/cplusplus/Icons.h index f042f901500..1e6802c7260 100644 --- a/src/libs/cplusplus/Icons.h +++ b/src/libs/cplusplus/Icons.h @@ -57,10 +57,16 @@ public: FuncPublicIconType, FuncProtectedIconType, FuncPrivateIconType, + FuncPublicStaticIconType, + FuncProtectedStaticIconType, + FuncPrivateStaticIconType, NamespaceIconType, VarPublicIconType, VarProtectedIconType, VarPrivateIconType, + VarPublicStaticIconType, + VarProtectedStaticIconType, + VarPrivateStaticIconType, SignalIconType, SlotPublicIconType, SlotProtectedIconType, @@ -81,10 +87,16 @@ private: QIcon _funcPublicIcon; QIcon _funcProtectedIcon; QIcon _funcPrivateIcon; + QIcon _funcPublicStaticIcon; + QIcon _funcProtectedStaticIcon; + QIcon _funcPrivateStaticIcon; QIcon _namespaceIcon; QIcon _varPublicIcon; QIcon _varProtectedIcon; QIcon _varPrivateIcon; + QIcon _varPublicStaticIcon; + QIcon _varProtectedStaticIcon; + QIcon _varPrivateStaticIcon; QIcon _signalIcon; QIcon _slotPublicIcon; QIcon _slotProtectedIcon; diff --git a/src/libs/cplusplus/cplusplus.qrc b/src/libs/cplusplus/cplusplus.qrc index 577d35cb45d..9b5812d83c1 100644 --- a/src/libs/cplusplus/cplusplus.qrc +++ b/src/libs/cplusplus/cplusplus.qrc @@ -1,5 +1,5 @@ - + images/class.png images/struct.png images/enum.png @@ -17,5 +17,11 @@ images/var.png images/var_priv.png images/var_prot.png + images/func_priv_st.png + images/func_prot_st.png + images/func_st.png + images/var_priv_st.png + images/var_prot_st.png + images/var_st.png diff --git a/src/libs/cplusplus/images/func_priv_st.png b/src/libs/cplusplus/images/func_priv_st.png new file mode 100644 index 0000000000000000000000000000000000000000..1d6fa2da795a058ffad34a501f397b00a9459926 GIT binary patch literal 685 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4rT@h1`S>QU}O*?_8Fz`kHy06>MzL~M@dQ#Vyt!G|O-|}qI`Ukx$j|P;vsOo**dg|4*%}@H* zT+f|w#5Hfbe&kAJZy{d(=M&f8&YOJFIe(vN!dBhzHLAV~q#W6pSv2GnXL_fdcP}|= zow3_EZj)BXN+s_FvQDpOZ@=bObJ{WgkY(ylgXj$!LCY09o*g~+ynV$bkMfgtIS0&= zw&_KzRr6mW=l1l-xxm0cIXSsog;OrLmK?Lm+-s7sMJH^viq9e$=b7R*`%Dve8^vza z3SOb)HBHcbm9p(j zcT6o>HMdQ|K75_6yV2x%E@D3SVr6{osvM^Iq-itP&itydI&1f~)K9m*aY*mVHLGQUOp5!(a5T`?~$?n;F}#Cv|<^Y@u1Y}E~4qw2dr%8`wkMMF+;rgz$T_mZR5 z8M}?+Hfe>dRPvrDY5#im_G^AMrycVTS*GqZh~A(Pv|Pbswz%!{_7#^r%1_$m9574T zrWdhR&3}oU+e}gGTZL0DxRxBV$=qv_utg_qe`Lj-mD^ukxW3Ocako+IMy=q33AJx7 z-YiPZT&3*0-78B@T1HMz?$V4E`N?T>r4`v27#K`Tg8YIRgr9#93%c^-LCU`mZ|zv+ z7XSOub9P$LzYmI4zdp@0eg5yORKcIG|DON*^jqfBKiyA%{@rWq3}WfyW?*30;OXKR zA|c6oaHCfkBSXW*_Xk9!TG%+V3NBtcBd}!QS=WFUjJK-#e{+0~tZ8;CC=qPcXl}AL zwX)Q_6K~@l%IZD!+Jl4Le{UaOddcd}{+i?We=ptAxH~-h!}~nXy@}Evp4Z^W|sSJlHqzw)r~YE}k*UmXaFTTfR%mvv4FO#npW6MX;x literal 0 HcmV?d00001 diff --git a/src/libs/cplusplus/images/func_st.png b/src/libs/cplusplus/images/func_st.png new file mode 100644 index 0000000000000000000000000000000000000000..05119102edc36a447a52ca8c81ea512a9a57f5f3 GIT binary patch literal 651 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4rT@h1`S>QUlacvAdQ&~K8bm~dk-fz& zvYt`3mO*)cT2nov%D&WwW=@?w@imQX8g+~+4J_&n%xd+_sxSK2ecgWc&5Ui=le)fa zJ@b0{mS>aJKj>X~G@$JB)>E&hZGO_f=6ddgBd&Sd^&?j*dw<$;>iNX=xAP{Sbk5&r zny^(je2uE_0x8E2>yO>fn|j{8Uzn;DQnqSRn$NWQ$VcO%pUKP-+?d3`z+hYw zbMNV?{#zT51}R2f7rWT1qTYKnTl_?CarbmRhiBWx&Ra69Tvq<- z_E#l#+l5*0t}d5(!x@s!Z}%)gVQ<#A$<0n|z8{{8d+pV=+@18`7bvnlUHx3vIVCg! E0L;h+&Hw-a literal 0 HcmV?d00001 diff --git a/src/libs/cplusplus/images/static.png b/src/libs/cplusplus/images/static.png new file mode 100644 index 0000000000000000000000000000000000000000..12c244780de35d4ab03c74a147bc5890f82a2250 GIT binary patch literal 164 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s7vOQfKLo80ey|9qCIe?+% zp}yjp0M90eO%ANa0%;kOt-=mYQiyEjoxowTaMx7Re1^EoAs=T4e^)R6)4^tZFQTwp z)Fx2Twe4YsA!p@5W>vG2`)5vEOgbbH{VuSDGyKiQCTp=hhh}b_Jh}c8&3A%? S-!L#RFnGH9xvXQU<3z`(*%ziB&L1d<@109!;NNDVs&ldvdDSOSPGDZ?F^oYdLN z7?uDsmV=X#o0l~*scz%8T^Fwu&RdHBh*1ux$kpSY;K|D@{n15(S^i_Twu`0=yA zz(6@Uxz3w+4UeAJ+prUer{4rqBOfvH1i|dW0yUm|C`AXf8 zP%+G1_IiGU)xNBfA^V2{{!_(EzWt~$(69BBr BAzlCg literal 0 HcmV?d00001 diff --git a/src/libs/cplusplus/images/var_prot_st.png b/src/libs/cplusplus/images/var_prot_st.png new file mode 100644 index 0000000000000000000000000000000000000000..f078b2fd34058828a59edd71fda8c87d77ae8b81 GIT binary patch literal 658 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4rT@h1`S>QU<3z`(*%ziB&L1d<@109!;NNDVs&ldvdDSOSPGDZ?F^oYdLN z7?uDsmV=X#o40P`w(_-`*dr3B?%XRBm%$pIn2?oSzIX*|c*4;ex8l+>KpMe#$V4$dt7pFcnEUeG%%`uWJ$&Z1_o%MDy%lh$Iff)IjX#QkL>C#5{uUe zOr5v+-6zY_S9A`YR^NF@apNwTl^ewtt`wL&XTi(2#wRXn??0)!{eaZ+^`i5a^G}@B zdGoH}(es*nkEv|kC%0y6;I4y9Z{0or@|DV_-AbEx%dXlSx##eO*Kbn_izFAUblSA@ z{OdQ;av(7E{H3J4{D9`X90mpkqmm%MUer{4rqBOQUprn_ggI-CHUob<^l^+jMgr9#9 zduzukH|O7np0m?j{(Vr)Kf3zEOjXanpHlDq{`Xbt-@i|vK7IXa)?+Tlz`(HB)5S4F zLX!2Mw)c`mhK7sJr}(?yVAN%PlzQwzk|4|MqxBEYn`Ri^>N!2TfP#ST=POpN zS|#)&>(H)CVtf3|`0MM}c;EhEJoEjhPuu)-Ka}s|*Z+U**5~@;zXd=1Suu6_(%1va zrZeX=)=AFNsb`Yw*|O2<=x4_7ZZDt66r_jDTB~=UH*jg1`}7@VtAfsoh3DD3hpwEZ jTUXPw$}3d1f7Pn|Z4T<@>t;Cdf+E+`)z4*}Q$iB}k%kIV literal 0 HcmV?d00001 diff --git a/src/plugins/classview/classviewutils.cpp b/src/plugins/classview/classviewutils.cpp index df84c472917..009a98d645b 100644 --- a/src/plugins/classview/classviewutils.cpp +++ b/src/plugins/classview/classviewutils.cpp @@ -54,6 +54,9 @@ const int IconSortOrder[] = { CPlusPlus::Icons::FuncPublicIconType, CPlusPlus::Icons::FuncProtectedIconType, CPlusPlus::Icons::FuncPrivateIconType, + CPlusPlus::Icons::FuncPublicStaticIconType, + CPlusPlus::Icons::FuncProtectedStaticIconType, + CPlusPlus::Icons::FuncPrivateStaticIconType, CPlusPlus::Icons::SignalIconType, CPlusPlus::Icons::SlotPublicIconType, CPlusPlus::Icons::SlotProtectedIconType, @@ -61,6 +64,9 @@ const int IconSortOrder[] = { CPlusPlus::Icons::VarPublicIconType, CPlusPlus::Icons::VarProtectedIconType, CPlusPlus::Icons::VarPrivateIconType, + CPlusPlus::Icons::VarPublicStaticIconType, + CPlusPlus::Icons::VarProtectedStaticIconType, + CPlusPlus::Icons::VarPrivateStaticIconType, CPlusPlus::Icons::EnumeratorIconType, CPlusPlus::Icons::KeywordIconType, CPlusPlus::Icons::MacroIconType,