]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/PartSet/PartSet_TreeNodes.cpp
Salome HOME
Issue #3221: Set disabled color of features in a non-active part
[modules/shaper.git] / src / PartSet / PartSet_TreeNodes.cpp
index 3bbc61c4994695d6bd2a0816c56c7e3ccb1a3ca4..ef099a03057cd51be209e37566d9b4ee81c81dac 100644 (file)
@@ -87,11 +87,16 @@ QVariant PartSet_TreeNode::data(int theColumn, int theRole) const
       return QBrush(DISABLED_COLOR);
     if (!aFlags.testFlag(Qt::ItemIsEditable))
       return QBrush(SELECTABLE_COLOR);
-    return ACTIVE_COLOR;
+    return activeItemColor();
   }
   return ModuleBase_ITreeNode::data(theColumn, theRole);
 }
 
+QColor PartSet_TreeNode::activeItemColor() const
+{
+  return ACTIVE_COLOR;
+}
+
 
 //////////////////////////////////////////////////////////////////////////////////
 QVariant PartSet_ObjectNode::data(int theColumn, int theRole) const
@@ -131,19 +136,21 @@ QVariant PartSet_ObjectNode::data(int theColumn, int theRole) const
       else
         return QIcon();
     }
-  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]);
-    }
-    break;
   }
   return PartSet_TreeNode::data(theColumn, theRole);
 }
 
+QColor PartSet_ObjectNode::activeItemColor() const
+{
+  if (myObject.get() && myObject->groupName() == ModelAPI_Feature::group()) {
+    std::vector<int> aColor =
+      Config_PropManager::color("Visualization", "feature_objectbrowser_color");
+    return QColor(aColor[0], aColor[1], aColor[2]);
+  }
+  return PartSet_TreeNode::activeItemColor();
+}
+
+
 Qt::ItemFlags PartSet_ObjectNode::flags(int theColumn) const
 {
   if (myObject->isDisabled()) {