From: Michal MalĂ˝ Date: Sat, 28 Feb 2015 18:28:22 +0000 (+0100) Subject: Determine whetner the "Single signal" view mode is active from states of X-Git-Tag: 0.4a~19 X-Git-Url: https://gitweb.devoid-pointer.net/?a=commitdiff_plain;h=481c71fc66a51de2d07648006f2fbb5a5ad71eb0;p=anyanka.git Determine whetner the "Single signal" view mode is active from states of other widgets instead of storing the state in a variable. --- diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index f41973c..c4982b0 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -29,7 +29,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), - m_singleSignalView(false), + //m_singleSignalView(false), ui(new Ui::MainWindow) { ui->setupUi(this); @@ -190,15 +190,23 @@ void MainWindow::onSWFullSizeToggle() QWidget* sender = qobject_cast(QObject::sender()); for (int idx = 0; idx < m_dashboard->count(); idx++) { - if (m_dashboard->widget(idx) != sender) { + /*if (m_dashboard->widget(idx) != sender) { if (!m_singleSignalView) m_dashboard->widget(idx)->hide(); else m_dashboard->widget(idx)->show(); + }*/ + QWidget* w = m_dashboard->widget(idx); + + if (w != sender) { + if (w->isHidden()) + w->show(); + else + w->hide(); } } - m_singleSignalView = !m_singleSignalView; + //m_singleSignalView = !m_singleSignalView; } void MainWindow::onZoomSelected() diff --git a/gui/mainwindow.h b/gui/mainwindow.h index b3f5da5..50b7bf1 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -58,7 +58,7 @@ private: //std::vector m_itemsOnDashboard; QSplitter* m_dashboard; QFileDialog* m_loadDataFileDialog; - bool m_singleSignalView; + //bool m_singleSignalView; Ui::MainWindow *ui; public slots: