From: Christophe Bourcier Date: Thu, 27 Apr 2023 17:28:26 +0000 (+0200) Subject: Make the text of the data of the object browser readable in dark theme. X-Git-Tag: V9_11_0a1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=16f385d064658d196e5af5f1f8d8ffc0b944bdec;p=modules%2Fshaper.git Make the text of the data of the object browser readable in dark theme. Don't hard code black, but use the same text color as the current theme --- diff --git a/src/PartSet/PartSet_TreeNodes.cpp b/src/PartSet/PartSet_TreeNodes.cpp index 9164dbc3d..e01af5f18 100644 --- a/src/PartSet/PartSet_TreeNodes.cpp +++ b/src/PartSet/PartSet_TreeNodes.cpp @@ -44,6 +44,7 @@ #include #include +#include #define ACTIVE_COLOR QColor(Qt::black) @@ -94,7 +95,11 @@ QVariant PartSet_TreeNode::data(int theColumn, int theRole) const 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; }