diff --git a/src/Gui/Icons/Geoassembly.svg b/src/Gui/Icons/Geoassembly.svg new file mode 100644 index 0000000000..1573e4dbb6 --- /dev/null +++ b/src/Gui/Icons/Geoassembly.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + Path-Stock + 2015-07-04 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Path/Gui/Resources/icons/Path-Stock.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Geofeaturegroup.svg b/src/Gui/Icons/Geofeaturegroup.svg index 1945b9a6fe..fea9f132bb 100644 --- a/src/Gui/Icons/Geofeaturegroup.svg +++ b/src/Gui/Icons/Geofeaturegroup.svg @@ -1,91 +1,304 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - Path-Stock - 2015-07-04 - http://www.freecadweb.org/wiki/index.php?title=Artwork - - - FreeCAD - - - FreeCAD/src/Mod/Path/Gui/Resources/icons/Path-Stock.svg - - - FreeCAD LGPL2+ - - - https://www.gnu.org/copyleft/lesser.html - - - [agryson] Alexander Gryson - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + Path-Stock + 2015-07-04 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Path/Gui/Resources/icons/Path-Stock.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/resource.qrc b/src/Gui/Icons/resource.qrc index 9de6436fbb..13ac71a492 100644 --- a/src/Gui/Icons/resource.qrc +++ b/src/Gui/Icons/resource.qrc @@ -216,6 +216,7 @@ AddonManager.svg Group.svg Geofeaturegroup.svg + Geoassembly.svg Std_Axis.svg Std_Plane.svg Link.svg diff --git a/src/Gui/ViewProviderPart.cpp b/src/Gui/ViewProviderPart.cpp index b39fdd109a..38543fc336 100644 --- a/src/Gui/ViewProviderPart.cpp +++ b/src/Gui/ViewProviderPart.cpp @@ -57,6 +57,7 @@ ViewProviderPart::ViewProviderPart() initExtension(this); sPixmap = "Geofeaturegroup.svg"; + aPixmap = "Geoassembly.svg"; } ViewProviderPart::~ViewProviderPart() @@ -112,6 +113,19 @@ bool ViewProviderPart::doubleClicked(void) return true; } +QIcon ViewProviderPart::getIcon(void) const +{ + // the original Part object for this ViewProviderPart + App::Part* part = static_cast(this->getObject()); + // the normal case for Std_Part + const char* pixmap = sPixmap; + // if it's flagged as an Assembly in its Type, it gets another icon + if (part->Type.getStrValue() == "Assembly") { pixmap = aPixmap; } + + return mergeGreyableOverlayIcons (Gui::BitmapFactory().pixmap(pixmap)); +} + + // Python feature ----------------------------------------------------------------------- namespace Gui { diff --git a/src/Gui/ViewProviderPart.h b/src/Gui/ViewProviderPart.h index fe0fb5eb6c..1d756321fd 100644 --- a/src/Gui/ViewProviderPart.h +++ b/src/Gui/ViewProviderPart.h @@ -45,10 +45,17 @@ public: virtual bool doubleClicked(void) override; virtual void setupContextMenu(QMenu* menu, QObject* receiver, const char* member) override; + + /// deliver the icon shown in the tree view + /// override from ViewProvider.h + virtual QIcon getIcon(void) const; protected: /// get called by the container whenever a property has been changed virtual void onChanged(const App::Property* prop) override; + /// a second icon for the Assembly type + const char* aPixmap; + }; typedef ViewProviderPythonFeatureT ViewProviderPartPython;