From 86b22fe3f6e8fbaf1c554e7cb54426633a4bcfc0 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Fri, 8 Nov 2019 10:42:37 +0800 Subject: [PATCH] Gui: force dynamic property item background and text color To avoid visual problem under dark theme. --- src/Gui/propertyeditor/PropertyItem.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Gui/propertyeditor/PropertyItem.cpp b/src/Gui/propertyeditor/PropertyItem.cpp index 0c644db283..c55acce3b9 100644 --- a/src/Gui/propertyeditor/PropertyItem.cpp +++ b/src/Gui/propertyeditor/PropertyItem.cpp @@ -526,13 +526,15 @@ QVariant PropertyItem::data(int column, int role) const { // property name if (column == 0) { - if (role == Qt::BackgroundRole) { + if (role == Qt::BackgroundRole || role == Qt::TextColorRole) { if(PropertyView::showAll() && propertyItems.size() == 1 && propertyItems.front()->testStatus(App::Property::PropDynamic) && !propertyItems.front()->testStatus(App::Property::LockDynamic)) { - return QBrush(QColor(0xFF,0xFF,0x99)); + return role==Qt::BackgroundRole + ? QVariant::fromValue(QColor(0xFF,0xFF,0x99)) + : QVariant::fromValue(QColor(0,0,0)); } return QVariant(); }