Commit 4c7cef82 authored by Alessandro Portale's avatar Alessandro Portale

CPlusPlus: New code model icons

Change-Id: I9ad6445319d85ffb652377a00256a68d56754352
Reviewed-by: default avatarDavid Schulz <david.schulz@theqtcompany.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 38ebfa95
......@@ -71,6 +71,15 @@ IconsModeDebugActiveColor=ff99aaef
IconsModeProjetcsActiveColor=ff80c342
IconsModeAnalyzeActiveColor=ff43adee
IconsModeHelpActiveColor=fff4be04
IconsCodeModelKeywordColor=ffaaaaaa
IconsCodeModelClassColor=ffc0b550
IconsCodeModelStructColor=ff53b053
IconsCodeModelFunctionColor=ffd34373
IconsCodeModelVariableColor=ff2bbbcc
IconsCodeModelEnumColor=ffc0b550
IconsCodeModelMacroColor=ff477ba0
IconsCodeModelOverlayBackgroundColor=88000000
IconsCodeModelOverlayForegroundColor=ffdcdcdc
InfoBarBackground=ff505000
InfoBarText=text
MenuBarEmptyAreaBackgroundColor=shadowBackground
......
......@@ -65,6 +65,15 @@ IconsModeDebugActiveColor=ffffffff
IconsModeProjetcsActiveColor=ffffffff
IconsModeAnalyzeActiveColor=ffffffff
IconsModeHelpActiveColor=ffffffff
IconsCodeModelKeywordColor=ff777777
IconsCodeModelClassColor=ffc0b550
IconsCodeModelStructColor=ff53b053
IconsCodeModelFunctionColor=fff36393
IconsCodeModelVariableColor=ff2bbbcc
IconsCodeModelEnumColor=ffc0b550
IconsCodeModelMacroColor=ff476ba0
IconsCodeModelOverlayBackgroundColor=70ffffff
IconsCodeModelOverlayForegroundColor=ff232425
InfoBarBackground=ffffffe1
InfoBarText=ff000000
MenuBarEmptyAreaBackgroundColor=ffff0000
......
......@@ -75,6 +75,15 @@ IconsModeDebugActiveColor=ff99aaef
IconsModeProjetcsActiveColor=ff80c342
IconsModeAnalyzeActiveColor=ff43adee
IconsModeHelpActiveColor=fff4be04
IconsCodeModelKeywordColor=ff777777
IconsCodeModelClassColor=ffc0b550
IconsCodeModelStructColor=ff53b053
IconsCodeModelFunctionColor=ffd34373
IconsCodeModelVariableColor=ff2bbbcc
IconsCodeModelEnumColor=ffc0b550
IconsCodeModelMacroColor=ff476ba0
IconsCodeModelOverlayBackgroundColor=70ffffff
IconsCodeModelOverlayForegroundColor=ff232425
InfoBarBackground=ffffffe1
InfoBarText=text
MenuBarEmptyAreaBackgroundColor=shadowBackground
......
......@@ -30,6 +30,8 @@
#include <cplusplus/Symbols.h>
#include <cplusplus/Type.h>
#include <utils/icon.h>
using namespace CPlusPlus;
using CPlusPlus::Icons;
......@@ -116,97 +118,177 @@ Icons::IconType Icons::iconTypeForSymbol(const Symbol *symbol)
QIcon Icons::iconForType(IconType type)
{
using namespace Utils;
static const IconMaskAndColor classRelationIcon {
QLatin1String(":/codemodel/images/classrelation.png"), Theme::IconsCodeModelOverlayForegroundColor};
static const IconMaskAndColor classRelationBackgroundIcon {
QLatin1String(":/codemodel/images/classrelationbackground.png"), Theme::IconsCodeModelOverlayBackgroundColor};
static const IconMaskAndColor classMemberFunctionIcon {
QLatin1String(":/codemodel/images/classmemberfunction.png"), Theme::IconsCodeModelFunctionColor};
static const IconMaskAndColor classMemberVariableIcon {
QLatin1String(":/codemodel/images/classmembervariable.png"), Theme::IconsCodeModelVariableColor};
static const IconMaskAndColor functionIcon {
QLatin1String(":/codemodel/images/member.png"), Theme::IconsCodeModelFunctionColor};
static const IconMaskAndColor variableIcon {
QLatin1String(":/codemodel/images/member.png"), Theme::IconsCodeModelVariableColor};
static const IconMaskAndColor signalIcon {
QLatin1String(":/codemodel/images/signal.png"), Theme::IconsCodeModelFunctionColor};
static const IconMaskAndColor slotIcon {
QLatin1String(":/codemodel/images/slot.png"), Theme::IconsCodeModelFunctionColor};
static const IconMaskAndColor protectedIcon {
QLatin1String(":/codemodel/images/protected.png"), Theme::IconsCodeModelOverlayForegroundColor};
static const IconMaskAndColor protectedBackgroundIcon {
QLatin1String(":/codemodel/images/protectedbackground.png"), Theme::IconsCodeModelOverlayBackgroundColor};
static const IconMaskAndColor privateIcon {
QLatin1String(":/codemodel/images/private.png"), Theme::IconsCodeModelOverlayForegroundColor};
static const IconMaskAndColor privateBackgroundIcon {
QLatin1String(":/codemodel/images/privatebackground.png"), Theme::IconsCodeModelOverlayBackgroundColor};
static const IconMaskAndColor staticIcon {
QLatin1String(":/codemodel/images/static.png"), Theme::IconsCodeModelOverlayForegroundColor};
static const IconMaskAndColor staticBackgroundIcon {
QLatin1String(":/codemodel/images/staticbackground.png"), Theme::IconsCodeModelOverlayBackgroundColor};
switch (type) {
case ClassIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/class.png"));
const static QIcon icon(Icon({
classRelationBackgroundIcon, classRelationIcon,
{QLatin1String(":/codemodel/images/classparent.png"), Theme::IconsCodeModelClassColor},
classMemberFunctionIcon, classMemberVariableIcon
}, Icon::Tint).icon());
return icon;
}
case StructIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/struct.png"));
const static QIcon icon(Icon({
classRelationBackgroundIcon, classRelationIcon,
{QLatin1String(":/codemodel/images/classparent.png"), Theme::IconsCodeModelStructColor},
classMemberFunctionIcon, classMemberVariableIcon
}, Icon::Tint).icon());
return icon;
}
case EnumIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/enum.png"));
const static QIcon icon(Icon({
{QLatin1String(":/codemodel/images/enum.png"), Theme::IconsCodeModelEnumColor}
}, Icon::Tint).icon());
return icon;
}
case EnumeratorIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/enumerator.png"));
const static QIcon icon(Icon({
{QLatin1String(":/codemodel/images/enumerator.png"), Theme::IconsCodeModelEnumColor}
}, Icon::Tint).icon());
return icon;
}
case FuncPublicIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/func.png"));
const static QIcon icon(Icon({
functionIcon}, Icon::Tint).icon());
return icon;
}
case FuncProtectedIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/func_prot.png"));
const static QIcon icon(Icon({
functionIcon, protectedBackgroundIcon, protectedIcon
}, Icon::Tint).icon());
return icon;
}
case FuncPrivateIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/func_priv.png"));
const static QIcon icon(Icon({
functionIcon, privateBackgroundIcon, privateIcon
}, Icon::Tint).icon());
return icon;
}
case FuncPublicStaticIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/func_st.png"));
const static QIcon icon(Icon({
functionIcon, staticBackgroundIcon, staticIcon
}, Icon::Tint).icon());
return icon;
}
case FuncProtectedStaticIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/func_prot_st.png"));
const static QIcon icon(Icon({
functionIcon, staticBackgroundIcon, staticIcon, protectedBackgroundIcon, protectedIcon
}, Icon::Tint).icon());
return icon;
}
case FuncPrivateStaticIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/func_priv_st.png"));
const static QIcon icon(Icon({
functionIcon, staticBackgroundIcon, staticIcon, privateBackgroundIcon, privateIcon
}, Icon::Tint).icon());
return icon;
}
case NamespaceIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/namespace.png"));
const static QIcon icon(Icon({
{QLatin1String(":/codemodel/images/namespace.png"), Theme::IconsCodeModelKeywordColor}
}, Icon::Tint).icon());
return icon;
}
case VarPublicIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/var.png"));
const static QIcon icon(Icon({
variableIcon
}, Icon::Tint).icon());
return icon;
}
case VarProtectedIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/var_prot.png"));
const static QIcon icon(Icon({
variableIcon, protectedBackgroundIcon, protectedIcon
}, Icon::Tint).icon());
return icon;
}
case VarPrivateIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/var_priv.png"));
const static QIcon icon(Icon({
variableIcon, privateBackgroundIcon, privateIcon
}, Icon::Tint).icon());
return icon;
}
case VarPublicStaticIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/var_st.png"));
const static QIcon icon(Icon({
variableIcon, staticBackgroundIcon, staticIcon
}, Icon::Tint).icon());
return icon;
}
case VarProtectedStaticIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/var_prot_st.png"));
const static QIcon icon(Icon({
variableIcon, staticBackgroundIcon, staticIcon, protectedBackgroundIcon, protectedIcon
}, Icon::Tint).icon());
return icon;
}
case VarPrivateStaticIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/var_priv_st.png"));
const static QIcon icon(Icon({
variableIcon, staticBackgroundIcon, staticIcon, privateBackgroundIcon, privateIcon
}, Icon::Tint).icon());
return icon;
}
case SignalIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/signal.png"));
const static QIcon icon(Icon({
signalIcon
}, Icon::Tint).icon());
return icon;
}
case SlotPublicIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/slot.png"));
const static QIcon icon(Icon({
slotIcon
}, Icon::Tint).icon());
return icon;
}
case SlotProtectedIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/slot_prot.png"));
const static QIcon icon(Icon({
slotIcon, protectedBackgroundIcon, protectedIcon
}, Icon::Tint).icon());
return icon;
}
case SlotPrivateIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/slot_priv.png"));
const static QIcon icon(Icon({
slotIcon, privateBackgroundIcon, privateIcon
}, Icon::Tint).icon());
return icon;
}
case KeywordIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/keyword.png"));
const static QIcon icon(Icon({
{QLatin1String(":/codemodel/images/keyword.png"), Theme::IconsCodeModelKeywordColor}
}, Icon::Tint).icon());
return icon;
}
case MacroIconType: {
const static QIcon icon(QLatin1String(":/codemodel/images/macro.png"));
const static QIcon icon(Icon({
{QLatin1String(":/codemodel/images/macro.png"), Theme::IconsCodeModelMacroColor}
}, Icon::Tint).icon());
return icon;
}
default:
......
<RCC>
<qresource prefix="/codemodel">
<file>images/class.png</file>
<file>images/struct.png</file>
<file>images/enum.png</file>
<file>images/enum@2x.png</file>
<file>images/enumerator.png</file>
<file>images/func.png</file>
<file>images/func_priv.png</file>
<file>images/func_prot.png</file>
<file>images/enumerator@2x.png</file>
<file>images/keyword.png</file>
<file>images/keyword@2x.png</file>
<file>images/macro.png</file>
<file>images/macro@2x.png</file>
<file>images/namespace.png</file>
<file>images/namespace@2x.png</file>
<file>images/signal.png</file>
<file>images/signal@2x.png</file>
<file>images/slot.png</file>
<file>images/slot_priv.png</file>
<file>images/slot_prot.png</file>
<file>images/var.png</file>
<file>images/var_priv.png</file>
<file>images/var_prot.png</file>
<file>images/func_priv_st.png</file>
<file>images/func_prot_st.png</file>
<file>images/func_st.png</file>
<file>images/var_priv_st.png</file>
<file>images/var_prot_st.png</file>
<file>images/var_st.png</file>
<file>images/slot@2x.png</file>
<file>images/member.png</file>
<file>images/member@2x.png</file>
<file>images/private.png</file>
<file>images/private@2x.png</file>
<file>images/privatebackground.png</file>
<file>images/privatebackground@2x.png</file>
<file>images/protected.png</file>
<file>images/protected@2x.png</file>
<file>images/protectedbackground.png</file>
<file>images/protectedbackground@2x.png</file>
<file>images/static.png</file>
<file>images/static@2x.png</file>
<file>images/staticbackground.png</file>
<file>images/staticbackground@2x.png</file>
<file>images/classmemberfunction.png</file>
<file>images/classmemberfunction@2x.png</file>
<file>images/classmembervariable.png</file>
<file>images/classmembervariable@2x.png</file>
<file>images/classparent.png</file>
<file>images/classparent@2x.png</file>
<file>images/classrelation.png</file>
<file>images/classrelation@2x.png</file>
<file>images/classrelationbackground.png</file>
<file>images/classrelationbackground@2x.png</file>
</qresource>
</RCC>
src/libs/cplusplus/images/enum.png

359 Bytes | W: | H:

src/libs/cplusplus/images/enum.png

112 Bytes | W: | H:

src/libs/cplusplus/images/enum.png
src/libs/cplusplus/images/enum.png
src/libs/cplusplus/images/enum.png
src/libs/cplusplus/images/enum.png
  • 2-up
  • Swipe
  • Onion skin
src/libs/cplusplus/images/enumerator.png

478 Bytes | W: | H:

src/libs/cplusplus/images/enumerator.png

124 Bytes | W: | H:

src/libs/cplusplus/images/enumerator.png
src/libs/cplusplus/images/enumerator.png
src/libs/cplusplus/images/enumerator.png
src/libs/cplusplus/images/enumerator.png
  • 2-up
  • Swipe
  • Onion skin
src/libs/cplusplus/images/keyword.png

341 Bytes | W: | H:

src/libs/cplusplus/images/keyword.png

139 Bytes | W: | H:

src/libs/cplusplus/images/keyword.png
src/libs/cplusplus/images/keyword.png
src/libs/cplusplus/images/keyword.png
src/libs/cplusplus/images/keyword.png
  • 2-up
  • Swipe
  • Onion skin
src/libs/cplusplus/images/macro.png

405 Bytes | W: | H:

src/libs/cplusplus/images/macro.png

133 Bytes | W: | H:

src/libs/cplusplus/images/macro.png
src/libs/cplusplus/images/macro.png
src/libs/cplusplus/images/macro.png
src/libs/cplusplus/images/macro.png
  • 2-up
  • Swipe
  • Onion skin
src/libs/cplusplus/images/namespace.png

377 Bytes | W: | H:

src/libs/cplusplus/images/namespace.png

130 Bytes | W: | H:

src/libs/cplusplus/images/namespace.png
src/libs/cplusplus/images/namespace.png
src/libs/cplusplus/images/namespace.png
src/libs/cplusplus/images/namespace.png
  • 2-up
  • Swipe
  • Onion skin
src/libs/cplusplus/images/signal.png

393 Bytes | W: | H:

src/libs/cplusplus/images/signal.png

199 Bytes | W: | H:

src/libs/cplusplus/images/signal.png
src/libs/cplusplus/images/signal.png
src/libs/cplusplus/images/signal.png
src/libs/cplusplus/images/signal.png
  • 2-up
  • Swipe
  • Onion skin
src/libs/cplusplus/images/slot.png

498 Bytes | W: | H:

src/libs/cplusplus/images/slot.png

188 Bytes | W: | H:

src/libs/cplusplus/images/slot.png
src/libs/cplusplus/images/slot.png
src/libs/cplusplus/images/slot.png
src/libs/cplusplus/images/slot.png
  • 2-up
  • Swipe
  • Onion skin
src/libs/cplusplus/images/static.png

164 Bytes | W: | H:

src/libs/cplusplus/images/static.png

120 Bytes | W: | H:

src/libs/cplusplus/images/static.png
src/libs/cplusplus/images/static.png
src/libs/cplusplus/images/static.png
src/libs/cplusplus/images/static.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -151,6 +151,18 @@ public:
IconsModeAnalyzeActiveColor,
IconsModeHelpActiveColor,
/* Code model Icons */
IconsCodeModelKeywordColor,
IconsCodeModelClassColor,
IconsCodeModelStructColor,
IconsCodeModelFunctionColor,
IconsCodeModelVariableColor,
IconsCodeModelEnumColor,
IconsCodeModelMacroColor,
IconsCodeModelOverlayBackgroundColor,
IconsCodeModelOverlayForegroundColor,
/* Output panes */
OutputPanes_DebugTextColor,
......
......@@ -275,6 +275,7 @@ GenericProposalWidgetPrivate::GenericProposalWidgetPrivate(QWidget *completionWi
, m_assistant(0)
, m_autoWidth(true)
{
m_completionListView->setIconSize(QSize(16, 16));
connect(m_completionListView, &QAbstractItemView::activated,
this, &GenericProposalWidgetPrivate::handleActivation);
......
This diff is collapsed.
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