diff --git a/app/include/MainWindow.h b/app/include/MainWindow.h index 4a6256e..77c6b09 100644 --- a/app/include/MainWindow.h +++ b/app/include/MainWindow.h @@ -23,17 +23,20 @@ #define SCIQLOP_MAINWINDOW_H #include +#include #include #include #include #include #include #include -//#include "../Core/qlopservice.h" -//#include "../Core/qlopgui.h" + +#include #include +Q_DECLARE_LOGGING_CATEGORY(LOG_MainWindow) + namespace Ui { class MainWindow; } // namespace Ui @@ -55,6 +58,8 @@ private: // QWidget *m_progressWidget; // QVBoxLayout *m_progressLayout; // QList m_qlopServices; + class MainWindowPrivate; + spimpl::unique_impl_ptr impl; }; #endif // SCIQLOP_MAINWINDOW_H diff --git a/app/src/MainWindow.cpp b/app/src/MainWindow.cpp index a8a7605..869a3b5 100644 --- a/app/src/MainWindow.cpp +++ b/app/src/MainWindow.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -31,6 +32,9 @@ #include #include #include +#include +#include + //#include //#include //#include @@ -42,22 +46,102 @@ //#include "cdfcodec.h" //#include "amdatxtcodec.h" //#include -#include -#include -#include -MainWindow::MainWindow(QWidget *parent) : QMainWindow{parent}, m_Ui{new Ui::MainWindow} + +#include "iostream" + +Q_LOGGING_CATEGORY(LOG_MainWindow, "MainWindow") + +class MainWindow::MainWindowPrivate { +public: + QSize m_LastOpenLeftInspectorSize; + QSize m_LastOpenRightInspectorSize; +}; + +MainWindow::MainWindow(QWidget *parent) + : QMainWindow{parent}, + m_Ui{new Ui::MainWindow}, + impl{spimpl::make_unique_impl()} { m_Ui->setupUi(this); - auto leftSidePane = m_Ui->leftInspectorSidePane->sidePane(); - leftSidePane->addAction("ACTION L1"); - leftSidePane->addAction("ACTION L2"); - leftSidePane->addAction("ACTION L3"); + + m_Ui->splitter->setCollapsible(1, false); + m_Ui->splitter->setCollapsible(3, false); + // Lambda that defines what's happened when clicking on the leftSidePaneInspector open button + auto openLeftInspector = [&](bool checked) { + + // Update of the last opened geometry + if (checked) { + impl->m_LastOpenLeftInspectorSize = m_Ui->leftMainInspectorWidget->size(); + } + + auto startSize = impl->m_LastOpenLeftInspectorSize; + auto endSize = startSize; + endSize.setWidth(0); + + QList currentSizes = m_Ui->splitter->sizes(); + if (checked) { + // adjust sizes individually here, e.g. + currentSizes[0] -= impl->m_LastOpenLeftInspectorSize.width(); + currentSizes[2] += impl->m_LastOpenLeftInspectorSize.width(); + m_Ui->splitter->setSizes(currentSizes); + } + else { + // adjust sizes individually here, e.g. + currentSizes[0] += impl->m_LastOpenLeftInspectorSize.width(); + currentSizes[2] -= impl->m_LastOpenLeftInspectorSize.width(); + m_Ui->splitter->setSizes(currentSizes); + } + + }; + + // Lambda that defines what's happened when clicking on the SidePaneInspector open button + auto openRightInspector = [&](bool checked) { + + // Update of the last opened geometry + if (checked) { + impl->m_LastOpenRightInspectorSize = m_Ui->rightMainInspectorWidget->size(); + } + + auto startSize = impl->m_LastOpenRightInspectorSize; + auto endSize = startSize; + endSize.setWidth(0); + + QList currentSizes = m_Ui->splitter->sizes(); + if (checked) { + // adjust sizes individually here, e.g. + currentSizes[4] -= impl->m_LastOpenRightInspectorSize.width(); + currentSizes[2] += impl->m_LastOpenRightInspectorSize.width(); + m_Ui->splitter->setSizes(currentSizes); + } + else { + // adjust sizes individually here, e.g. + currentSizes[4] += impl->m_LastOpenRightInspectorSize.width(); + currentSizes[2] -= impl->m_LastOpenRightInspectorSize.width(); + m_Ui->splitter->setSizes(currentSizes); + } + + }; + + + QToolBar *leftSidePane = m_Ui->leftInspectorSidePane->sidePane(); + auto openLeftInspectorAction = leftSidePane->addAction( + QIcon{ + ":/icones/openInspector.png", + }, + "ACTION L1", openLeftInspector); + + openLeftInspectorAction->setCheckable(true); auto rightSidePane = m_Ui->rightInspectorSidePane->sidePane(); - rightSidePane->addAction("ACTION R1"); - rightSidePane->addAction("ACTION R2"); - rightSidePane->addAction("ACTION R3"); + auto openRightInspectorAction = rightSidePane->addAction( + QIcon{ + ":/icones/openInspector.png", + }, + "ACTION L1", openRightInspector); + + openRightInspectorAction->setCheckable(true); + this->menuBar()->addAction("File"); auto mainToolBar = this->addToolBar("MainToolBar"); diff --git a/app/ui/MainWindow.ui b/app/ui/MainWindow.ui index 9fef44e..1b9b0ff 100644 --- a/app/ui/MainWindow.ui +++ b/app/ui/MainWindow.ui @@ -34,7 +34,7 @@ - 3 + 0 0 @@ -49,129 +49,73 @@ 0 - - - - 3 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 3 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - 3 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - 3 - - - 0 - - - 0 - - - 0 - - - 0 + + + Qt::Horizontal + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + + + + + 0 + 0 + - - - - - - - - 3 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + @@ -182,7 +126,7 @@ 0 0 800 - 26 + 28 diff --git a/gui/resources/icones/openInspector.png b/gui/resources/icones/openInspector.png new file mode 100755 index 0000000000000000000000000000000000000000..ca13c20f8ed91585f2519264cfde1aae04bdb0aa GIT binary patch literal 1450 zc$@*M1y%ZqP)tsMO3T`))!G*L?Ojuu|9|og8JYe(5DJDq68Fwr1qf_!AiC9 zM-@u^QK1PWCfiogn)opHfIgrH*a9ps^3ET?55O=m1RMp%4P^|DCSVuv zF*1^~6<#yIhrmM-?Vt#00c(M$qpKz5`4}()d=HEQ(}>xFOovrK9_RvYLaZl=N#J$h zji_A{SO)AvI+Gl|A>c{i21-+Q1JI2q^V1Z%)4+4U(hwb}1lxh{hzmCX90WE7wt%f&IWg#7CtcF=s0@1J5J7hU0rF;+r$%8^cQA1L7lb7}?sg!g}CH zLWV*7wrYlTzzM~)06b{T^ndUOa6!rQInZjwY#ne~G5Zl&v8#<6firlyzQsTZ&BRCk z3q&Ecf_C5}UcO-h`V5W4=llsoA+?4U;!1dzKnvr3;$~kM(G-0sW15A7K&+wib*R@!IPTE?RatfbYk?g}&5;4>~5W_3f?E z0!$%&8K-zM29RWi)7n8Z(cn(RpFaZJVaVrYe1Gm+$O|8-7ea=#Nmws}4x1F8!D4@I z!>6%^426R16aa7>?-#_fRY_NI2R?H%U@TOYcsu%S1n$xgk_zZk?N2Nv${5<3bsztu z0OvN2A<4^n!PodCYRu=zCE8n}_6Ra(>IE~vH&MF_m7vuM*nruK~IT%VeOYurt( z0PXIMW*|`37**{K*U$>k9^bUJG*y7^(_CM*0(3^TK>eYp0xnBv1)Nvy#T)?52c5^9 zv+!KnO-hWN7YT|g;5XIITT4>~bgK4Q*U$?11u0H|#gY6h6|PTHz&UqQD_{nx%m6u` z&$@iZ5;I+)(?^j&{5OfmJ(%*d86E<0*>O%<6cXN zGR8g8?phUrDz~4=Tk<)Wr02TAn#S+&xO9Y8i}4}kr-ip zaMA27pc8TI+yPIjCC?WPP9kM#AXDPC(9#*B0kL9d@-I+Ej$4q2Iie>? zFNUr*Rs*N-at;tMpj&|yA!;SGhaw&T9mG3-9Jo3(lUAe%QBQ~N&`ip}HsB|`T&EBR z$ONrOIO&*OL<*9sfd=4l{DS93-mLQuO~8AK=`2!^biFlWg?x$(0~nb7e8?e1h;EB? z+vEXk7sxe8{gSH#bX(nCs+7U%LF(}INK7GRDVqZF*$ljbch9wxQ}I4uDV883@H=tg z+?;#{xP{UVVRFE&h?RYoLU#iB6sK$t&mpAQtOA}uI-FLnK8d*2`lBi5pEpNWCz8G0 zO8Qh9N20nnso~?h-!P`knJYOlS7mgMrwbqAJW^_?J!7_!Uu7{BX z<}ng!tdPihj{2%jxq_O;zdMYR6%EGQng9R*07*qoM6N<$ Eg3E%EY5)KL literal 0 Hc$@ + + icones/openInspector.png + + diff --git a/gui/src/SidePane/SqpSidePane.cpp b/gui/src/SidePane/SqpSidePane.cpp index da69e6c..72e6ea9 100644 --- a/gui/src/SidePane/SqpSidePane.cpp +++ b/gui/src/SidePane/SqpSidePane.cpp @@ -24,16 +24,23 @@ static const QString SQPSIDEPANESTYLESHEET SqpSidePane::SqpSidePane(QWidget *parent) : QWidget{parent}, ui{new Ui::SqpSidePane} { - QVBoxLayout *sidePaneLayout = new QVBoxLayout(this); - sidePaneLayout->setContentsMargins(0, 0, 0, 0); - this->setLayout(sidePaneLayout); + // QVBoxLayout *sidePaneLayout = new QVBoxLayout(this); + // sidePaneLayout->setContentsMargins(0, 0, 0, 0); + // this->setLayout(sidePaneLayout); ui->setupUi(this); - m_SidePaneToolbar = new QToolBar(this); + m_SidePaneToolbar = new QToolBar(); m_SidePaneToolbar->setOrientation(Qt::Vertical); - sidePaneLayout->addWidget(m_SidePaneToolbar); + this->layout()->addWidget(m_SidePaneToolbar); m_SidePaneToolbar->setStyleSheet(SQPSIDEPANESTYLESHEET); + + this->setStyleSheet( + " QWidget {" + "background: red;" + + "border: 1px;" + " }"); } SqpSidePane::~SqpSidePane() diff --git a/gui/src/Visualization/VisualizationWidget.cpp b/gui/src/Visualization/VisualizationWidget.cpp index 14b8f90..91c1f61 100644 --- a/gui/src/Visualization/VisualizationWidget.cpp +++ b/gui/src/Visualization/VisualizationWidget.cpp @@ -20,7 +20,7 @@ VisualizationWidget::VisualizationWidget(QWidget *parent) addTabViewButton->setAutoRaise(true); ui->tabWidget->setCornerWidget(addTabViewButton, Qt::TopRightCorner); - auto addTabView = [&](bool checked) { + auto addTabView = [&]() { auto index = ui->tabWidget->addTab(new VisualizationTabWidget(ui->tabWidget), QString("View %1").arg(ui->tabWidget->count() + 1)); qCInfo(LOG_VisualizationWidget()) << tr("add the tab of index %1").arg(index); diff --git a/gui/ui/DataSource/DataSourceWidget.ui b/gui/ui/DataSource/DataSourceWidget.ui index a7cf875..473ed3b 100644 --- a/gui/ui/DataSource/DataSourceWidget.ui +++ b/gui/ui/DataSource/DataSourceWidget.ui @@ -14,8 +14,26 @@ Data sources + + 0 + + + 0 + + + 0 + + + 0 + - + + + + 1 + + + diff --git a/gui/ui/sidepane/SqpSidePane.ui b/gui/ui/sidepane/SqpSidePane.ui index 1213ccc..2b99c76 100644 --- a/gui/ui/sidepane/SqpSidePane.ui +++ b/gui/ui/sidepane/SqpSidePane.ui @@ -1,21 +1,42 @@ + - - - SqpSidePane - + 0 0 - 400 - 300 + 12 + 12 + + + 45 + 16777215 + + Form + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + - +