// aTreeView->setExpanded(myActivePartIndex, false);
XGUI_DataModel* aDataModel = aWorkshop->objectBrowser()->dataModel();
+ QModelIndex aOldActive = myActivePartIndex;
myActivePartIndex = aDataModel->documentRootIndex(aActiveDoc, 0);
bool needUpdate = false;
if (myActivePartIndex.isValid()) {
if (!needUpdate)
aTreeView->setExpanded(myActivePartIndex, true);
}
+ if ((aOldActive != myActivePartIndex) && (aOldActive.isValid()))
+ aTreeView->setExpanded(aOldActive, false);
aLabel->setPalette(aPalet);
aWorkshop->updateCommandStatus();
case 2:
if (isCurrentFeature(myObject))
return QIcon(":pictures/arrow.png");
+ else
+ return QIcon();
}
}
return PartSet_TreeNode::data(theColumn, theRole);
}
if ((theColumn == 2) && (theRole == Qt::DecorationRole)) {
if (document().get()) {
+ SessionPtr aSession = ModelAPI_Session::get();
+ if (document() != aSession->activeDocument())
+ return QIcon();
+
FeaturePtr aFeature = document()->currentFeature(true);
if (!aFeature.get()) { // There is no current feature
ModuleBase_ITreeNode* aLastFolder = 0;
}
if (aLastFolder == this)
return QIcon(":pictures/arrow.png");
+ else
+ return QIcon();
}
}
}
case Qt::DecorationRole:
return ModuleBase_IconFactory::get()->getIcon(myObject);
}
+ case 2:
+ if (theRole == Qt::DecorationRole) {
+ if (isCurrentFeature(myObject))
+ return QIcon(":pictures/arrow.png");
+ else
+ return QIcon();
+ }
}
return PartSet_TreeNode::data(theColumn, theRole);
}
Qt::ItemFlags PartSet_PartRootNode::flags(int theColumn) const
{
+ if (myObject->isDisabled())
+ return (theColumn == 2) ? Qt::ItemIsSelectable : aNullFlag;
+
SessionPtr aSession = ModelAPI_Session::get();
DocumentPtr aActiveDoc = aSession->activeDocument();
if ((aActiveDoc == document()) || (myObject->document() == aActiveDoc))