Skip to content
Snippets Groups Projects
Commit 4ff7469b authored by t.knopff's avatar t.knopff
Browse files

Small improvement in plot view: make buttons for properties and fourier checkable

parent aaa822f7
No related branches found
No related tags found
1 merge request!398Overhaul UI: small improvement in plot view: make buttons for properties and fourier checkable
Pipeline #47019 passed
......@@ -33,7 +33,8 @@ IntensityDataFFTPresenter::IntensityDataFFTPresenter(QWidget* parent)
m_fftAction->setText("Fourier");
m_fftAction->setIcon(QIcon(":/images/alpha-f-box.svg"));
m_fftAction->setToolTip("Get the Fourier Transform of current intensity map");
connect(m_fftAction, &QAction::triggered, this, &IntensityDataFFTPresenter::onFFTActionRequest);
m_fftAction->setCheckable(true);
connect(m_fftAction, &QAction::toggled, this, &IntensityDataFFTPresenter::onFFTActionToggled);
}
void IntensityDataFFTPresenter::reset()
......@@ -65,8 +66,8 @@ bool IntensityDataFFTPresenter::inFFTMode() const
return m_in_fft_mode;
}
void IntensityDataFFTPresenter::onFFTActionRequest()
void IntensityDataFFTPresenter::onFFTActionToggled(bool toggled)
{
m_in_fft_mode = !m_in_fft_mode;
m_in_fft_mode = toggled;
fftActionRequest();
}
......@@ -42,7 +42,7 @@ signals:
void fftActionRequest();
private slots:
void onFFTActionRequest();
void onFFTActionToggled(bool toggled);
private:
QAction* m_fftAction;
......
......@@ -36,7 +36,8 @@ IntensityDataPropertyWidget::IntensityDataPropertyWidget(QWidget* parent)
m_togglePanelAction->setText("Properties");
m_togglePanelAction->setIcon(QIcon(":/images/dock-right.svg"));
m_togglePanelAction->setToolTip("Toggle property panel");
connect(m_togglePanelAction, &QAction::triggered, this,
m_togglePanelAction->setCheckable(true);
connect(m_togglePanelAction, &QAction::toggled, this,
&IntensityDataPropertyWidget::onTogglePanelAction);
}
......@@ -57,9 +58,9 @@ QList<QAction*> IntensityDataPropertyWidget::actionList()
return QList<QAction*>() << m_togglePanelAction;
}
void IntensityDataPropertyWidget::onTogglePanelAction()
void IntensityDataPropertyWidget::onTogglePanelAction(bool toggled)
{
setVisible(!isVisible());
setVisible(toggled);
}
void IntensityDataPropertyWidget::subscribeToItem()
......
......@@ -34,7 +34,7 @@ public:
QList<QAction*> actionList();
public slots:
void onTogglePanelAction();
void onTogglePanelAction(bool toggled);
protected:
virtual void subscribeToItem();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment