diff --git a/copasi/UI/CQFittingWidget.cpp b/copasi/UI/CQFittingWidget.cpp index c3d11471d4..c89aaa6731 100644 --- a/copasi/UI/CQFittingWidget.cpp +++ b/copasi/UI/CQFittingWidget.cpp @@ -373,6 +373,44 @@ void CQFittingWidget::init() mpCurrentList = mpParameters; mpExperimentSet = NULL; mpCrossValidationSet = NULL; + + // add 2 more tab pages that when clicked will increase / decrease the height of the tab widget + QToolButton * tb = new QToolButton(); + tb->setText("+"); + QObject::connect(tb, SIGNAL(clicked()), this, SLOT(slotIncreaseTabHeight())); + // Add empty, not enabled tab to tabWidget + mpTabWidget->addTab(new QLabel("Add height by pressing \"+\""), QString()); + mpTabWidget->setTabEnabled(2, false); + // Add tab button to current tab. Button will be enabled, but tab -- not + mpTabWidget->tabBar()->setTabButton(2, QTabBar::RightSide, tb); + + tb = new QToolButton(); + tb->setText("-"); + QObject::connect(tb, SIGNAL(clicked()), this, SLOT(slotDecreaseTabHeight())); + // Add empty, not enabled tab to tabWidget + mpTabWidget->addTab(new QLabel("Remove height by pressing \"-\""), QString()); + mpTabWidget->setTabEnabled(3, false); + // Add tab button to current tab. Button will be enabled, but tab -- not + mpTabWidget->tabBar()->setTabButton(3, QTabBar::RightSide, tb); + + +} + +void CQFittingWidget::slotIncreaseTabHeight() +{ + auto height = mpTabWidget->height(); + height += 100; + mpTabWidget->setMinimumHeight(height); +} + + +void CQFittingWidget::slotDecreaseTabHeight() +{ + auto height = mpTabWidget->height(); + if (height < 300) + return; + height -= 100; + mpTabWidget->setMinimumHeight(height); } void CQFittingWidget::slotParameterNumberChanged(int number) diff --git a/copasi/UI/CQFittingWidget.h b/copasi/UI/CQFittingWidget.h index 2db20ef366..2956d604cc 100644 --- a/copasi/UI/CQFittingWidget.h +++ b/copasi/UI/CQFittingWidget.h @@ -41,6 +41,8 @@ class CQFittingWidget : public TaskWidget, public Ui::CQFittingWidget public slots: void slotParameterNumberChanged(int number); void slotConstraintNumberChanged(int number); + void slotIncreaseTabHeight(); + void slotDecreaseTabHeight(); protected: CQFittingItemWidget * mpCurrentList; diff --git a/copasi/UI/CQOptimizationWidget.cpp b/copasi/UI/CQOptimizationWidget.cpp index ab4fafbae5..c8877b8e7c 100644 --- a/copasi/UI/CQOptimizationWidget.cpp +++ b/copasi/UI/CQOptimizationWidget.cpp @@ -242,8 +242,44 @@ void CQOptimizationWidget::init() connect(mpConstraints, SIGNAL(numberChanged(int)), this, SLOT(slotConstraintNumberChanged(int))); mpCurrentList = mpParameters; + + // add 2 more tab pages that when clicked will increase / decrease the height of the tab widget + QToolButton * tb = new QToolButton(); + tb->setText("+"); + QObject::connect(tb, SIGNAL(clicked()), this, SLOT(slotIncreaseTabHeight())); + // Add empty, not enabled tab to tabWidget + mpTabWidget->addTab(new QLabel("Add height by pressing \"+\""), QString()); + mpTabWidget->setTabEnabled(2, false); + // Add tab button to current tab. Button will be enabled, but tab -- not + mpTabWidget->tabBar()->setTabButton(2, QTabBar::RightSide, tb); + + tb = new QToolButton(); + tb->setText("-"); + QObject::connect(tb, SIGNAL(clicked()), this, SLOT(slotDecreaseTabHeight())); + // Add empty, not enabled tab to tabWidget + mpTabWidget->addTab(new QLabel("Remove height by pressing \"-\""), QString()); + mpTabWidget->setTabEnabled(3, false); + // Add tab button to current tab. Button will be enabled, but tab -- not + mpTabWidget->tabBar()->setTabButton(3, QTabBar::RightSide, tb); +} + +void CQOptimizationWidget::slotIncreaseTabHeight() +{ + auto height = mpTabWidget->height(); + height += 100; + mpTabWidget->setMinimumHeight(height); } +void CQOptimizationWidget::slotDecreaseTabHeight() +{ + auto height = mpTabWidget->height(); + if (height < 300) + return; + height -= 100; + mpTabWidget->setMinimumHeight(height); +} + + void CQOptimizationWidget::destroy() {} diff --git a/copasi/UI/CQOptimizationWidget.h b/copasi/UI/CQOptimizationWidget.h index 5010e0927e..1e2dd07d5d 100644 --- a/copasi/UI/CQOptimizationWidget.h +++ b/copasi/UI/CQOptimizationWidget.h @@ -45,6 +45,9 @@ public slots: void slotParameterNumberChanged(int number); void slotConstraintNumberChanged(int number); virtual void slotEditExpression(); + void slotIncreaseTabHeight(); + void slotDecreaseTabHeight(); + protected: CQFittingItemWidget * mpCurrentList;