Active container (light gray) and edit (yellow) colors in Tree view are now changeable in prefs->display->colors

This commit is contained in:
Yorik van Havre
2018-04-19 18:25:48 -03:00
parent 869b5c8918
commit 10e33d03f8
3 changed files with 300 additions and 246 deletions

View File

@@ -977,8 +977,10 @@ DocumentItem::~DocumentItem()
void DocumentItem::slotInEdit(const Gui::ViewProviderDocumentObject& v)
{
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/TreeView");
unsigned long col = hGrp->GetUnsigned("TreeEditColor",4294902015);
FOREACH_ITEM(item,v)
item->setBackgroundColor(0,Qt::yellow);
item->setBackgroundColor(0,QColor((col >> 24) & 0xff,(col >> 16) & 0xff,(col >> 8) & 0xff));
END_FOREACH_ITEM
}
@@ -1279,8 +1281,11 @@ void DocumentItem::slotHighlightObject (const Gui::ViewProviderDocumentObject& o
item->setData(0, Qt::BackgroundColorRole,QVariant());
break;
case Gui::LightBlue:
if (set)
item->setBackgroundColor(0,QColor(230,230,255));
if (set) {
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/TreeView");
unsigned long col = hGrp->GetUnsigned("TreeActiveColor",3873898495);
item->setBackgroundColor(0,QColor((col >> 24) & 0xff,(col >> 16) & 0xff,(col >> 8) & 0xff));
}
else
item->setData(0, Qt::BackgroundColorRole,QVariant());
break;