From: vsv Date: Wed, 21 Aug 2019 10:19:03 +0000 (+0300) Subject: Issue #2981: Update color bar on modification of preferences X-Git-Tag: VEDF2019Lot4~40 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=315f1e7ebc1a5f3120774a5b926a126aa9293825;p=modules%2Fshaper.git Issue #2981: Update color bar on modification of preferences --- diff --git a/src/SHAPERGUI/SHAPERGUI.cpp b/src/SHAPERGUI/SHAPERGUI.cpp index 61716cafc..2ff3a2887 100644 --- a/src/SHAPERGUI/SHAPERGUI.cpp +++ b/src/SHAPERGUI/SHAPERGUI.cpp @@ -792,32 +792,32 @@ void SHAPERGUI::createPreferences() int colorScaleGroup = pref->addItem(tr("Color scale"), viewTab); pref->setItemProperty("columns", 4, colorScaleGroup); - int aItem = pref->addItem(tr("X position"), colorScaleGroup, + int aItem = aMgr.addPreference(tr("X position"), colorScaleGroup, SUIT_PreferenceMgr::Double, ModuleBase_Preferences::VIEWER_SECTION, "scalar_bar_x_position"); pref->setItemProperty("min", 0, aItem); pref->setItemProperty("max", 1, aItem); - aItem = pref->addItem(tr("Y position"), colorScaleGroup, + aItem = aMgr.addPreference(tr("Y position"), colorScaleGroup, SUIT_PreferenceMgr::Double, ModuleBase_Preferences::VIEWER_SECTION, "scalar_bar_y_position"); pref->setItemProperty("min", 0, aItem); pref->setItemProperty("max", 1, aItem); - aItem = pref->addItem(tr("Width"), colorScaleGroup, + aItem = aMgr.addPreference(tr("Width"), colorScaleGroup, SUIT_PreferenceMgr::Double, ModuleBase_Preferences::VIEWER_SECTION, "scalar_bar_width"); pref->setItemProperty("min", 0, aItem); pref->setItemProperty("max", 1, aItem); - aItem = pref->addItem(tr("Height"), colorScaleGroup, + aItem = aMgr.addPreference(tr("Height"), colorScaleGroup, SUIT_PreferenceMgr::Double, ModuleBase_Preferences::VIEWER_SECTION, "scalar_bar_height"); pref->setItemProperty("min", 0, aItem); pref->setItemProperty("max", 1, aItem); - aItem = pref->addItem(tr("Intervals number"), colorScaleGroup, + aItem = aMgr.addPreference(tr("Intervals number"), colorScaleGroup, SUIT_PreferenceMgr::Integer, ModuleBase_Preferences::VIEWER_SECTION, "scalar_bar_nb_intervals"); pref->setItemProperty("min", 0, aItem); pref->setItemProperty("max", 100, aItem); - aItem = pref->addItem(tr("Text height"), colorScaleGroup, + aItem = aMgr.addPreference(tr("Text height"), colorScaleGroup, SUIT_PreferenceMgr::Integer, ModuleBase_Preferences::VIEWER_SECTION, "scalar_bar_text_height"); pref->setItemProperty("min", 0, aItem); pref->setItemProperty("max", 100, aItem); diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 099d61ad0..2b1c9a1ab 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -370,11 +370,16 @@ void XGUI_Displayer::redisplayObjects() // redisplay objects visualized in the viewer static Events_ID EVENT_DISP = Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY); static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get(); - QObjectPtrList aDisplayed = myWorkshop->displayer()->displayedObjects(); + QObjectPtrList aDisplayed = displayedObjects(); QObjectPtrList::const_iterator anIt = aDisplayed.begin(), aLast = aDisplayed.end(); for (; anIt != aLast; anIt++) { aECreator->sendUpdated(*anIt, EVENT_DISP); } + XGUI_ViewerProxy* aViewer = myWorkshop->viewer(); + if (aViewer->isColorScaleVisible()) { + aViewer->setupColorScale(); + aViewer->setColorScaleShown(true); + } Events_Loop::loop()->flush(EVENT_DISP); }