Skip to content

Commit

Permalink
Gui: add completer icon for property alias
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder committed Jun 16, 2020
1 parent a2fd843 commit 39cd5c1
Show file tree
Hide file tree
Showing 3 changed files with 315 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Gui/ExpressionCompleter.cpp
Expand Up @@ -511,6 +511,14 @@ class ExpressionCompleterModel: public QAbstractItemModel {
return propName.mid(1);
return propName;
case Qt::DecorationRole:
if (prop->getName()) {
static QIcon icon(BitmapFactory().pixmap("ClassBrowser/alias.svg"));
if(propName.startsWith(QLatin1Char('.'))) {
if (propName != QString::fromLatin1(".%1").arg(QLatin1String(prop->getName())))
return icon;
} else if (propName != QString::fromLatin1(prop->getName()))
return icon;
}
return CallTipsList::iconOfType(CallTip::Property);
case Qt::ToolTipRole: {
const char *docu = prop->getDocumentation();
Expand Down
306 changes: 306 additions & 0 deletions src/Gui/Icons/ClassBrowser/alias.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/Gui/Icons/resource.qrc
Expand Up @@ -43,6 +43,7 @@
<file>ClassBrowser/type_module.svg</file>
<file>ClassBrowser/sub_path.svg</file>
<file>ClassBrowser/unit.svg</file>
<file>ClassBrowser/alias.svg</file>
<file>ClassBrowser/function.svg</file>
<file>style/windows_branch_closed.png</file>
<file>style/windows_branch_open.png</file>
Expand Down

0 comments on commit 39cd5c1

Please sign in to comment.