From 5aedc73ef6cdb2094e42d2522181dac5a577b0b8 Mon Sep 17 00:00:00 2001 From: Uwe Date: Sat, 23 Jul 2022 16:57:16 +0200 Subject: [PATCH] [FEM] better fix for missing colorbar update for FemPostObject - better fix for #7230 because we can call the direct paint method and because the bar is now also updated when the object is shown - also add a ToDo note --- src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp b/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp index 15b3efe31e..74e3eea236 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp @@ -664,11 +664,20 @@ void ViewProviderFemPostObject::unsetEdit(int ModNum) { void ViewProviderFemPostObject::hide(void) { Gui::ViewProviderDocumentObject::hide(); m_colorStyle->style = SoDrawStyle::INVISIBLE; + // TODO: the object is now hidden but the color bar is wrong + // if there are other FemPostObjects visible + // one must first search if there are other FemPostObjects visible + // in the tree view above this one and refresh ist color bar by updating + // its Field property + // if this is not the case, the colorbar of the next visible FemPostObjects + // has t be refreshed } void ViewProviderFemPostObject::show(void) { Gui::ViewProviderDocumentObject::show(); m_colorStyle->style = SoDrawStyle::FILLED; + // we must update the color bar + WriteColorData(true); } @@ -727,10 +736,7 @@ void ViewProviderFemPostObject::selectionChanged(const Gui::SelectionChanges &se if (obj.getObject() == this->getObject()) { if (!this->getObject()->Visibility.getValue()) return; - auto propField = Base::freecad_dynamic_cast( - getPropertyByName("Field")); - if (propField) - propField->touch(); + WriteColorData(true); } } }