[Meas]Fix visibility at load (#23145)
* [Meas]Fix visibility at load * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -230,8 +230,10 @@ void ViewProviderMeasureBase::setDisplayMode(const char* ModeName)
|
||||
|
||||
void ViewProviderMeasureBase::finishRestoring()
|
||||
{
|
||||
// Force measurement visibility when loading a document
|
||||
show();
|
||||
if (Visibility.getValue() && isSubjectVisible()) {
|
||||
show();
|
||||
}
|
||||
ViewProviderDocumentObject::finishRestoring();
|
||||
}
|
||||
|
||||
|
||||
@@ -254,6 +256,7 @@ void ViewProviderMeasureBase::onChanged(const App::Property* prop)
|
||||
pLabel->size = FontSize.getValue();
|
||||
fieldFontSize.setValue(FontSize.getValue());
|
||||
}
|
||||
|
||||
ViewProviderDocumentObject::onChanged(prop);
|
||||
}
|
||||
|
||||
@@ -522,6 +525,7 @@ void ViewProviderMeasureBase::onSubjectVisibilityChanged(const App::DocumentObje
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
std::string propName = prop.getName();
|
||||
if (propName == "Visibility") {
|
||||
if (!docObj.Visibility.getValue()) {
|
||||
@@ -531,7 +535,7 @@ void ViewProviderMeasureBase::onSubjectVisibilityChanged(const App::DocumentObje
|
||||
else {
|
||||
// here, we don't know if we should be visible or not, so we have to check the whole
|
||||
// subject
|
||||
setVisible(isSubjectVisible());
|
||||
setVisible(isSubjectVisible() && Visibility.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user