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);
// 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);
}