From 10e33d03f80ce91dd7d523f24e9e761a53b3fe6b Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Thu, 19 Apr 2018 18:25:48 -0300 Subject: [PATCH] Active container (light gray) and edit (yellow) colors in Tree view are now changeable in prefs->display->colors --- src/Gui/DlgSettingsViewColor.cpp | 4 + src/Gui/DlgSettingsViewColor.ui | 469 +++++++++++++++++-------------- src/Gui/Tree.cpp | 11 +- 3 files changed, 269 insertions(+), 215 deletions(-) diff --git a/src/Gui/DlgSettingsViewColor.cpp b/src/Gui/DlgSettingsViewColor.cpp index 4283162e5761..37fddaa2dd47 100644 --- a/src/Gui/DlgSettingsViewColor.cpp +++ b/src/Gui/DlgSettingsViewColor.cpp @@ -67,6 +67,8 @@ void DlgSettingsViewColor::saveSettings() HighlightColor->onSave(); SelectionColor->onSave(); spinPickRadius->onSave(); + TreeEditColor->onSave(); + TreeActiveColor->onSave(); } void DlgSettingsViewColor::loadSettings() @@ -83,6 +85,8 @@ void DlgSettingsViewColor::loadSettings() HighlightColor->onRestore(); SelectionColor->onRestore(); spinPickRadius->onRestore(); + TreeEditColor->onRestore(); + TreeActiveColor->onRestore(); } /** diff --git a/src/Gui/DlgSettingsViewColor.ui b/src/Gui/DlgSettingsViewColor.ui index c1c9b46f7358..543008a392bb 100644 --- a/src/Gui/DlgSettingsViewColor.ui +++ b/src/Gui/DlgSettingsViewColor.ui @@ -6,148 +6,148 @@ 0 0 - 601 - 598 + 505 + 609 Colors - - 9 - - - 9 - - - 9 - - + 9 6 - - + + - Selection + Background color - - 9 - - - 9 - - - 9 - - + 9 6 - + Qt::Horizontal - 183 - 23 + 40 + 20 - - - 0 - - - 0 - - - 0 - - + + 0 6 - - + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 171 + 20 + + + + + + false + + + 0 + 0 + + - + - 28 - 173 - 28 + 20 + 20 + 163 - SelectionColor + BackgroundColor View - - - - - 240 - 0 - + + + + Middle color + + + UseBackgroundColorMid + + + View + + + + - Enable preselection highlighting + - - true + + + 151 + 151 + 170 + - EnablePreselection + BackgroundColor3 View - - + + false - - - 0 - 0 - - - + - 225 - 225 - 20 + 111 + 111 + 147 - HighlightColor + BackgroundColor4 View @@ -155,50 +155,54 @@ - + - Enable selection highlighting + Color gradient true - EnableSelection + Gradient View - - + + - Pick radius (px): - - - - - - - Sets the area of confusion for picking elements in 3D view. Larger value makes it easier to pick stuff, but will make some small features impossible to select. + - - Qt::ImhPreferNumbers + + + 51 + 51 + 101 + - - 1 + + BackgroundColor2 - - 0.500000000000000 + + View - - 200.000000000000000 + + + + + + + 240 + 0 + - - 5.000000000000000 + + Simple color - PickRadius + Simple View @@ -210,75 +214,99 @@ - - + + + + Qt::Vertical + + + + 20 + 40 + + + + + + - Background color + Selection - - 9 - - - 9 - - - 9 - - + 9 6 - + Qt::Horizontal - 40 - 20 + 183 + 23 - - - 0 - - - 0 - - - 0 - - + + 0 6 - - - - Qt::Horizontal + + + + false - - QSizePolicy::Minimum + + - + + + 28 + 173 + 28 + + + + SelectionColor + + + View + + + + + + - 171 - 20 + 240 + 0 - + + Enable preselection highlighting + + + true + + + EnablePreselection + + + View + + - + false @@ -291,150 +319,167 @@ - + - 20 - 20 - 163 + 225 + 225 + 20 - BackgroundColor + HighlightColor View - - + + - Middle color + Enable selection highlighting + + + true - UseBackgroundColorMid + EnableSelection View - - + + - + Pick radius (px): - - - 151 - 151 - 170 - + + + + + + Sets the area of confusion for picking elements in 3D view. Larger value makes it easier to pick stuff, but will make some small features impossible to select. + + + Qt::ImhPreferNumbers + + + 1 + + + 0.500000000000000 + + + 200.000000000000000 + + + 5.000000000000000 - BackgroundColor3 + PickRadius View - - - - false - - - - - + + + + + + + + + Tree View + + + + + + + - 111 - 111 - 147 + 230 + 230 + 255 - BackgroundColor4 + TreeActiveColor - View + TreeView - + - Color gradient - - - true - - - Gradient - - - View + Active container - - + + - + Object being edited - + + + + + - 51 - 51 - 101 + 255 + 255 + 0 - BackgroundColor2 + TreeEditColor - View + TreeView - - - + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + 240 - 0 + 20 - - Simple color - - - Simple - - - View - - + + + + + Qt::Horizontal + + + + 40 + 20 + + + + - - - - Qt::Vertical - - - - 20 - 40 - - - - diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp index 3f36bbf96e98..3f903926b9e4 100644 --- a/src/Gui/Tree.cpp +++ b/src/Gui/Tree.cpp @@ -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;