From 16f385d064658d196e5af5f1f8d8ffc0b944bdec Mon Sep 17 00:00:00 2001 From: Christophe Bourcier Date: Thu, 27 Apr 2023 19:28:26 +0200 Subject: [PATCH] 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 --- src/PartSet/PartSet_TreeNodes.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; } -- 2.39.2