]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #3221: Set gray color for disabled features
authorvsv <vsv@opencascade.com>
Mon, 20 Jul 2020 11:20:23 +0000 (14:20 +0300)
committervsv <vsv@opencascade.com>
Mon, 20 Jul 2020 11:20:35 +0000 (14:20 +0300)
src/PartSet/PartSet_TreeNodes.cpp

index 114eea0a5a6dfb8154a55cb568b2d257a5510d71..3bbc61c4994695d6bd2a0816c56c7e3ccb1a3ca4 100644 (file)
@@ -133,6 +133,8 @@ QVariant PartSet_ObjectNode::data(int theColumn, int theRole) const
     }
   case Qt::ForegroundRole:
     if (myObject->groupName() == ModelAPI_Feature::group()) {
+      if (myObject->isDisabled())
+        return PartSet_TreeNode::data(theColumn, theRole);
       std::vector<int> aColor =
         Config_PropManager::color("Visualization", "feature_objectbrowser_color");
       return QColor(aColor[0], aColor[1], aColor[2]);
@@ -1211,9 +1213,11 @@ QTreeNodesList PartSet_ObjectFolderNode::objectsDeleted(const DocumentPtr& /*the
 QVariant PartSet_ObjectFolderNode::data(int theColumn, int theRole) const
 {
   if (theRole == Qt::ForegroundRole) {
-    std::vector<int> aColor =
-      Config_PropManager::color("Visualization", "feature_objectbrowser_color");
-    return QColor(aColor[0], aColor[1], aColor[2]);
+    if (!myObject->isDisabled()) {
+      std::vector<int> aColor =
+        Config_PropManager::color("Visualization", "feature_objectbrowser_color");
+      return QColor(aColor[0], aColor[1], aColor[2]);
+    }
   }
   return PartSet_ObjectNode::data(theColumn, theRole);