[Gui] Fix AxisLetterColor on opening Preferences and correct LightSources parameter group
Also remove workaround as stated in the comments just before 1.1.0 Release.
This commit is contained in:
@@ -220,7 +220,7 @@ void DlgSettingsLightSources::configureViewer()
|
||||
{
|
||||
const SbVec3f defaultViewDirection {0.0f, 1.0f, 0.3f};
|
||||
|
||||
View3DSettings(hGrp, view).applySettings();
|
||||
View3DSettings(hGrpView, view).applySettings();
|
||||
|
||||
view->setRedirectToSceneGraph(true);
|
||||
view->setViewing(true);
|
||||
|
||||
@@ -82,6 +82,9 @@ private:
|
||||
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath(
|
||||
"User parameter:BaseApp/Preferences/View/LightSources"
|
||||
);
|
||||
ParameterGrp::handle hGrpView = App::GetApplication().GetParameterGroupByPath(
|
||||
"User parameter:BaseApp/Preferences/View"
|
||||
);
|
||||
|
||||
float zoomStep = 3.0f;
|
||||
};
|
||||
|
||||
@@ -95,6 +95,15 @@ void View3DSettings::applySettings()
|
||||
OnChange(*hGrp, "UseVBO");
|
||||
OnChange(*hGrp, "RenderCache");
|
||||
OnChange(*hGrp, "Orthographic");
|
||||
OnChange(*hGrp, "NavigationStyle");
|
||||
OnChange(*hGrp, "OrbitStyle");
|
||||
OnChange(*hGrp, "Sensitivity");
|
||||
OnChange(*hGrp, "ResetCursorPosition");
|
||||
OnChange(*hGrp, "DimensionsVisible");
|
||||
OnChange(*hGrp, "Dimensions3dVisible");
|
||||
OnChange(*hGrp, "DimensionsDeltaVisible");
|
||||
OnChange(*hGrp, "PickRadius");
|
||||
OnChange(*hGrp, "TransparentObjectRenderType");
|
||||
|
||||
auto lightSourcesGrp = hGrp->GetGroup("LightSources");
|
||||
OnChange(*lightSourcesGrp, "EnableHeadlight");
|
||||
@@ -111,39 +120,6 @@ void View3DSettings::applySettings()
|
||||
OnChange(*lightSourcesGrp, "FillLightIntensity");
|
||||
OnChange(*lightSourcesGrp, "AmbientLightColor");
|
||||
OnChange(*lightSourcesGrp, "AmbientLightIntensity");
|
||||
|
||||
// Workaround
|
||||
// Clear old settings that was used for a while in 1.1dev
|
||||
// By clearing these settings, 1.0 will be able to run with same config file again
|
||||
// For more info: https://github.com/FreeCAD/FreeCAD/issues/19880
|
||||
// TODO: Remove when 1.1.0 is about to be released
|
||||
if (hGrp->GetASCII("FillLightDirection").empty()) {
|
||||
hGrp->RemoveBool("EnableHeadlight");
|
||||
hGrp->RemoveUnsigned("HeadlightColor");
|
||||
hGrp->RemoveASCII("HeadlightDirection");
|
||||
hGrp->RemoveInt("HeadlightIntensity");
|
||||
hGrp->RemoveBool("EnableBacklight");
|
||||
hGrp->RemoveUnsigned("BacklightColor");
|
||||
hGrp->RemoveASCII("BacklightDirection");
|
||||
hGrp->RemoveInt("BacklightIntensity");
|
||||
hGrp->RemoveBool("EnableFillLight");
|
||||
hGrp->RemoveUnsigned("FillLightColor");
|
||||
hGrp->RemoveASCII("FillLightDirection");
|
||||
hGrp->RemoveInt("FillLightIntensity");
|
||||
hGrp->RemoveUnsigned("AmbientLightColor");
|
||||
hGrp->RemoveInt("AmbientLightIntensity");
|
||||
}
|
||||
// End of workaround
|
||||
|
||||
OnChange(*hGrp, "NavigationStyle");
|
||||
OnChange(*hGrp, "OrbitStyle");
|
||||
OnChange(*hGrp, "Sensitivity");
|
||||
OnChange(*hGrp, "ResetCursorPosition");
|
||||
OnChange(*hGrp, "DimensionsVisible");
|
||||
OnChange(*hGrp, "Dimensions3dVisible");
|
||||
OnChange(*hGrp, "DimensionsDeltaVisible");
|
||||
OnChange(*hGrp, "PickRadius");
|
||||
OnChange(*hGrp, "TransparentObjectRenderType");
|
||||
}
|
||||
|
||||
void View3DSettings::OnChange(ParameterGrp::SubjectType& rCaller, ParameterGrp::MessageType Reason)
|
||||
|
||||
Reference in New Issue
Block a user