modified ViewProviderPart to show different icon for Assembly-Type
This commit is contained in:
@@ -57,6 +57,7 @@ ViewProviderPart::ViewProviderPart()
|
||||
initExtension(this);
|
||||
|
||||
sPixmap = "Geofeaturegroup.svg";
|
||||
aPixmap = "Geoassembly.svg";
|
||||
}
|
||||
|
||||
ViewProviderPart::~ViewProviderPart()
|
||||
@@ -112,6 +113,20 @@ bool ViewProviderPart::doubleClicked(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
QIcon ViewProviderPart::getIcon(void) const
|
||||
{
|
||||
// the original Part object for this ViewProviderPart
|
||||
App::Part* part = static_cast<App::Part*>(this->getObject());
|
||||
// the normal case for Std_Part
|
||||
const char* pixmap = sPixmap;
|
||||
std::string type = part->Type.getStrValue();
|
||||
// if it's flagged as an Assembly in its Type, it gets another icon
|
||||
if (type == "Assembly") { pixmap = aPixmap; }
|
||||
|
||||
return mergeGreyableOverlayIcons (Gui::BitmapFactory().pixmap(pixmap));
|
||||
}
|
||||
|
||||
|
||||
// Python feature -----------------------------------------------------------------------
|
||||
|
||||
namespace Gui {
|
||||
|
||||
Reference in New Issue
Block a user