diff --git a/GUI/Views/IntensityDataWidgets/IntensityDataFFTPresenter.cpp b/GUI/Views/IntensityDataWidgets/IntensityDataFFTPresenter.cpp index e1ad7d16f83c0c93d97ec612b82d46f966903b9a..d438708642c3f7f4cd6670a82f83a8cc4a2f623c 100644 --- a/GUI/Views/IntensityDataWidgets/IntensityDataFFTPresenter.cpp +++ b/GUI/Views/IntensityDataWidgets/IntensityDataFFTPresenter.cpp @@ -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(); } diff --git a/GUI/Views/IntensityDataWidgets/IntensityDataFFTPresenter.h b/GUI/Views/IntensityDataWidgets/IntensityDataFFTPresenter.h index 2276aee3110a92fc378dd3c7e55f0565d6e03404..7fabfc77bf335c94c4117dcac8027bb275cc69ee 100644 --- a/GUI/Views/IntensityDataWidgets/IntensityDataFFTPresenter.h +++ b/GUI/Views/IntensityDataWidgets/IntensityDataFFTPresenter.h @@ -42,7 +42,7 @@ signals: void fftActionRequest(); private slots: - void onFFTActionRequest(); + void onFFTActionToggled(bool toggled); private: QAction* m_fftAction; diff --git a/GUI/Views/IntensityDataWidgets/IntensityDataPropertyWidget.cpp b/GUI/Views/IntensityDataWidgets/IntensityDataPropertyWidget.cpp index 9bb7cf65d4063a0c1ab697cc7cce21dd9b1046b4..2473ba731a827c9d091fc89e4bc8ef18e5037cbd 100644 --- a/GUI/Views/IntensityDataWidgets/IntensityDataPropertyWidget.cpp +++ b/GUI/Views/IntensityDataWidgets/IntensityDataPropertyWidget.cpp @@ -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() diff --git a/GUI/Views/IntensityDataWidgets/IntensityDataPropertyWidget.h b/GUI/Views/IntensityDataWidgets/IntensityDataPropertyWidget.h index fdb51e021a6881c226a52e276af4dc36add57326..8c3a008a509bb156632c48fb40f8ede98f6433bf 100644 --- a/GUI/Views/IntensityDataWidgets/IntensityDataPropertyWidget.h +++ b/GUI/Views/IntensityDataWidgets/IntensityDataPropertyWidget.h @@ -34,7 +34,7 @@ public: QList<QAction*> actionList(); public slots: - void onTogglePanelAction(); + void onTogglePanelAction(bool toggled); protected: virtual void subscribeToItem();