diff --git a/gui/src/Variable/VariableInspectorWidget.cpp b/gui/src/Variable/VariableInspectorWidget.cpp index 038bcdb..c157aa1 100644 --- a/gui/src/Variable/VariableInspectorWidget.cpp +++ b/gui/src/Variable/VariableInspectorWidget.cpp @@ -63,6 +63,19 @@ public: } else { QStyledItemDelegate::paint(painter, option, index); + + // Sets color depending on the state + auto stateRoleData = index.data(VariableRoles::StateRole); + if (stateRoleData.canConvert()) { + auto stateData = stateRoleData.value(); + + auto color = QColor{stateData.value("color").toString()}; + if (color.isValid()) { + auto newOption = option; + newOption.palette.setBrush(QPalette::Text, QBrush{color}); + QStyledItemDelegate::paint(painter, newOption, index); + } + } } }