-// Copyright (C) 2014-2021 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2024 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <QBrush>
#include <QMap>
+#include <QPalette>
#define ACTIVE_COLOR QColor(Qt::black)
QColor PartSet_TreeNode::activeItemColor() const
{
- return ACTIVE_COLOR;
+ // instead of ACTIVE_COLOR (black),
+ // use the color text of the current theme (white or black or other)
+ // to make it readable in dark theme (and light theme as well)
+ QColor color = QPalette().text().color() ;
+ return color;
}
} else {
DocumentPtr aDoc = myObject->document();
SessionPtr aSession = ModelAPI_Session::get();
+
+ FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(myObject);
+ if (aFeature.get() && aFeature->getKind() == "Group")
+ {
+ std::shared_ptr<ModelAPI_CompositeFeature> anOwner =
+ ModelAPI_Tools::compositeOwner (aFeature);
+
+ if (anOwner.get() && anOwner->getKind() == "ImportResult")
+ return aDefaultFlag;
+ }
+
if (aSession->activeDocument() == aDoc)
return aEditingFlag;
}