Skip to content

Commit

Permalink
Gui: improve property editor status update
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder committed May 16, 2020
1 parent 3d1d3cd commit 2421f14
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions src/Gui/PropertyView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,29 @@ void PropertyView::slotRemoveDynamicProperty(const App::Property& prop)
void PropertyView::slotChangePropertyEditor(const App::Document &, const App::Property& prop)
{
App::PropertyContainer* parent = prop.getContainer();
if (parent && parent->isDerivedFrom(App::DocumentObject::getClassTypeId())) {
propertyEditorData->updateEditorMode(prop);
Gui::PropertyEditor::PropertyEditor* editor = nullptr;

if (parent && propertyEditorData->propOwners.count(parent))
editor = propertyEditorData;
else if (parent && propertyEditorView->propOwners.count(parent))
editor = propertyEditorView;
else
return;

if(showAll() || isPropertyHidden(&prop)) {
editor->updateEditorMode(prop);
return;
}
else if (parent && parent->isDerivedFrom(Gui::ViewProvider::getClassTypeId())) {
propertyEditorView->updateEditorMode(prop);
for(auto &v : editor->propList) {
for(auto p : v.second)
if(p == &prop) {
editor->updateEditorMode(prop);
return;
}
}
// The property is not in the list, probably because it is hidden before.
// So perform a full update.
timer->start(50);
}

void PropertyView::slotDeleteDocument(const Gui::Document &doc) {
Expand Down

0 comments on commit 2421f14

Please sign in to comment.