From: jfa Date: Fri, 20 Jan 2023 15:13:13 +0000 (+0300) Subject: Option to show/hide axes now works also in default attributes mode X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fjfa%2Fview_cube;p=modules%2Fgui.git Option to show/hide axes now works also in default attributes mode --- diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index e84d52a59..49972104e 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -2867,6 +2867,9 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) pref->setItemProperty( "min", 0.1, viewcube_dur ); pref->setItemProperty( "max", 10.0, viewcube_dur ); pref->setItemProperty( "step", 0.1, viewcube_dur ); + // .... -> show view cube axes + pref->addPreference( tr( "PREF_VIEWCUBE_AXES" ), occViewCubeGroup, + LightApp_Preferences::Bool, "OCCViewer", "viewcube_axes" ); // ... "View cube" group <> // ... "View cube default (OCCT) attributes" group <> @@ -2885,9 +2888,6 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) // .... -> text color pref->addPreference( tr( "PREF_VIEWCUBE_TEXTCOLOR" ), occViewCubeAttrsGroup, LightApp_Preferences::Color, "OCCViewer", "viewcube_text_color" ); - // .... -> show view cube axes - pref->addPreference( tr( "PREF_VIEWCUBE_AXES" ), occViewCubeAttrsGroup, - LightApp_Preferences::Bool, "OCCViewer", "viewcube_axes" ); // ... "View cube" group <> // ... -> empty frame (for layout) <> diff --git a/src/OCCViewer/OCCViewer_ViewModel.cxx b/src/OCCViewer/OCCViewer_ViewModel.cxx index b3bb6b5c3..377664756 100644 --- a/src/OCCViewer/OCCViewer_ViewModel.cxx +++ b/src/OCCViewer/OCCViewer_ViewModel.cxx @@ -1380,14 +1380,14 @@ void OCCViewer_Viewer::setViewCubeParamsFromPreferences() // Text color aColor = resMgr->colorValue("OCCViewer", "viewcube_text_color", QColor(0, 0, 0)); myViewCube->SetTextColor(OCCViewer::color(aColor)); - - // Axes - myViewCube->SetDrawAxes(resMgr->booleanValue("OCCViewer", "viewcube_axes", true)); } else { myViewCube->ResetStyles(); } + // Axes + myViewCube->SetDrawAxes(resMgr->booleanValue("OCCViewer", "viewcube_axes", false)); + // Animation duration (sec) myViewCube->SetDuration(resMgr->doubleValue("OCCViewer", "viewcube_duration", 0.5));