diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/DynamicPDF/SliceSelector.ui b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/DynamicPDF/SliceSelector.ui index 4e0ad8b978ff4cc9edc702a81b972f9af10d4486..07ce00809984ec533b66dd41102c646622d1c28e 100644 --- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/DynamicPDF/SliceSelector.ui +++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/DynamicPDF/SliceSelector.ui @@ -85,6 +85,17 @@ </item> </layout> </item> + <item> + <layout class="QHBoxLayout" name="layout2Dview"> + <item> + <widget class="QSlider" name="sliderSelectSlice"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + </widget> + </item> + </layout> + </item> <item> <widget class="QGroupBox" name="groupPlotSelectedSlice"> <property name="title"> diff --git a/MantidQt/CustomInterfaces/src/DynamicPDF/SliceSelector.cpp b/MantidQt/CustomInterfaces/src/DynamicPDF/SliceSelector.cpp index cc0dd762bf873ab9a7a0f05b5edf3857fde3487f..142e12169b6d7d1fda22df77a60a2bdd30c7591c 100644 --- a/MantidQt/CustomInterfaces/src/DynamicPDF/SliceSelector.cpp +++ b/MantidQt/CustomInterfaces/src/DynamicPDF/SliceSelector.cpp @@ -49,6 +49,8 @@ void SliceSelector::initLayout() { connect(m_uiForm.pushHelp, SIGNAL(clicked()), this, SLOT(showHelp())); connect(m_uiForm.spinboxSliceSelector, SIGNAL(valueChanged(int)), this, SLOT(updateSelectedSlice(int))); + connect(m_uiForm.sliderSelectSlice, SIGNAL(valueChanged(int)), this, + SLOT(updateSelectedSlice(int))); connect(m_uiForm.pushLaunchBackgroundRemover, SIGNAL(clicked()), this, SLOT(launchBackgroundRemover())); } @@ -72,7 +74,15 @@ void SliceSelector::loadSlices(const QString &workspaceName) { m_uiForm.spinboxSliceSelector->setMaximum( static_cast<int>(maximumWorkspaceIndex)); m_uiForm.spinboxSliceSelector->setValue( - static_cast<int>(m_selectedWorkspaceIndex)); + static_cast<int>(0)); + m_uiForm.spinboxSliceSelector->setSingleStep(1); + + /// initialize the slider in the 2D view + m_uiForm.sliderSelectSlice->setMinimum(0); + m_uiForm.sliderSelectSlice->setMaximum( + static_cast<int>(maximumWorkspaceIndex)); + m_uiForm.spinboxSliceSelector->setValue( + static_cast<int>(0)); /// initialize the preview plot updatePlotSelectedSlice(); @@ -92,6 +102,8 @@ void SliceSelector::updateSelectedSlice(const int &newSelectedIndex) { m_loadedWorkspace->updateMetadata(m_selectedWorkspaceIndex); m_uiForm.labelSliceEnergy->setText( QString::fromStdString(m_loadedWorkspace->m_label)); + m_uiForm.spinboxSliceSelector->setValue(m_selectedWorkspaceIndex); + m_uiForm.sliderSelectSlice->setValue(m_selectedWorkspaceIndex); updatePlotSelectedSlice(); }