From 2be7bbf141f5a21e936ede51078883ddc60d85d2 Mon Sep 17 00:00:00 2001 From: Syres916 <46537884+Syres916@users.noreply.github.com> Date: Wed, 26 Nov 2025 18:04:58 +0000 Subject: [PATCH] [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. --- .../DlgSettingsLightSources.cpp | 2 +- .../PreferencePages/DlgSettingsLightSources.h | 3 ++ src/Gui/View3DSettings.cpp | 42 ++++--------------- 3 files changed, 13 insertions(+), 34 deletions(-) diff --git a/src/Gui/PreferencePages/DlgSettingsLightSources.cpp b/src/Gui/PreferencePages/DlgSettingsLightSources.cpp index 6be8a23847..4ad0203dd0 100644 --- a/src/Gui/PreferencePages/DlgSettingsLightSources.cpp +++ b/src/Gui/PreferencePages/DlgSettingsLightSources.cpp @@ -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); diff --git a/src/Gui/PreferencePages/DlgSettingsLightSources.h b/src/Gui/PreferencePages/DlgSettingsLightSources.h index e93ae68070..437fbc1494 100644 --- a/src/Gui/PreferencePages/DlgSettingsLightSources.h +++ b/src/Gui/PreferencePages/DlgSettingsLightSources.h @@ -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; }; diff --git a/src/Gui/View3DSettings.cpp b/src/Gui/View3DSettings.cpp index f8181b04ec..e13a24ea97 100644 --- a/src/Gui/View3DSettings.cpp +++ b/src/Gui/View3DSettings.cpp @@ -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)