Commit 103f7e2c authored by Mathieu Tillet's avatar Mathieu Tillet
Browse files

Fix issues with the pick tab on integration change

When switching from an integrable workspace to a non-integrable one,
there was an issue with the top of the instrument widget, with was shown
as an artifact.
When switching from a non-integrable workspace to an integrable one, the
mini-plot didn't expand correctly.
parent 38646eb5
......@@ -39,6 +39,7 @@ public:
void setWidget(QWidget *widget);
void setCaption(const QString &caption);
void collapseCaption() { m_label->collapse(); }
void expandCaption() { m_label->expand(); }
bool isCollapsed() const;
signals:
void collapsed();
......
......@@ -588,6 +588,9 @@ void InstrumentWidget::replaceWorkspace(
renameWorkspace(newWs);
m_instrumentActor.reset(new InstrumentActor(QString::fromStdString(newWs)));
// update the integration widget
updateIntegrationWidget();
// update the view and colormap
auto surface = getSurface();
surface->resetInstrumentActor(m_instrumentActor.get());
......@@ -596,9 +599,6 @@ void InstrumentWidget::replaceWorkspace(
// reset the instrument position
m_renderTab->resetView();
// update the integration widget
updateIntegrationWidget();
// reset the plot and the info widget in the pick tab
m_pickTab->clearWidgets();
......@@ -608,7 +608,10 @@ void InstrumentWidget::replaceWorkspace(
}
/**
* @brief InstrumentWidget::updateIntegrationWidget
* Update the range of the integration widget, and show or hide it is needed
* @param init : boolean set to true if the integration widget is still being
* initialized
*/
void InstrumentWidget::updateIntegrationWidget(bool init) {
m_xIntegration->setTotalRange(m_instrumentActor->minBinValue(),
......
......@@ -304,7 +304,8 @@ InstrumentWidgetPickTab::InstrumentWidgetPickTab(InstrumentWidget *instrWidget)
void InstrumentWidgetPickTab::collapsePlotPanel() {
if (!m_instrWidget->isIntegrable()) {
m_plotPanel->collapseCaption();
}
} else
m_plotPanel->expandCaption();
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment