diff --git a/companion/src/modeledit/curves.cpp b/companion/src/modeledit/curves.cpp index 444e39a90..e9b13897b 100644 --- a/companion/src/modeledit/curves.cpp +++ b/companion/src/modeledit/curves.cpp @@ -109,18 +109,29 @@ Curves::Curves(QWidget * parent, ModelData & model, GeneralSettings & generalSet QGraphicsScene *scene = new QGraphicsScene(ui->curvePreview); scene->setItemIndexMethod(QGraphicsScene::NoIndex); ui->curvePreview->setScene(scene); - - for (int i=0; igetCapability(NumCurves); i++) { + int numcurves=firmware->getCapability(NumCurves); + int limit; + if (numcurves>16) { + limit=numcurves/2; + } else { + limit=numcurves; + } + for (int i=0; isetProperty("index", i); reset->setMinimumSize(QSize(0, 0)); + reset->setMaximumSize(QSize(16, 16)); reset->setIcon(CompanionIcon("clear.png")); reset->setIconSize(QSize(14, 14)); connect(reset, SIGNAL(clicked()), this, SLOT(resetCurve())); - ui->curvesLayout->addWidget(reset, i, 0, 1, 1); + if (icurvesLayout->addWidget(reset, i, 0, 1, 1); + } else { + ui->curvesLayout2->addWidget(reset, i-limit, 0, 1, 1); + } // The edit curve button QPushButton * edit = new QPushButton(this); @@ -136,14 +147,29 @@ Curves::Curves(QWidget * parent, ModelData & model, GeneralSettings & generalSet edit->setPalette(palette); edit->setText(tr("Curve %1").arg(i+1)); connect(edit, SIGNAL(clicked()), this, SLOT(editCurve())); - ui->curvesLayout->addWidget(edit, i, 1, 1, 1); + if (icurvesLayout->addWidget(edit, i, 1, 1, 1); + } else { + ui->curvesLayout2->addWidget(edit, i-limit, 1, 1, 1); + } // The curve plot checkbox QCheckBox * plot = new QCheckBox(this); plot->setProperty("index", i); plot->setPalette(palette); connect(plot, SIGNAL(toggled(bool)), this, SLOT(plotCurve(bool))); - ui->curvesLayout->addWidget(plot, i, 2, 1, 1); + if (icurvesLayout->addWidget(plot, i, 2, 1, 1); + } else { + ui->curvesLayout2->addWidget(plot, i-limit, 2, 1, 1); + } + } + QSpacerItem * item = new QSpacerItem(1,1, QSizePolicy::Fixed, QSizePolicy::Expanding); + + ui->curvesLayout->addItem(item,limit+1,1,1,1,0); + if (limit!=numcurves) { + QSpacerItem * item2 = new QSpacerItem(1,1, QSizePolicy::Fixed, QSizePolicy::Expanding); + ui->curvesLayout2->addItem(item2,limit+1,1,1,1,0); } for (int i=0; i 0 0 - 718 + 624 539 @@ -125,6 +125,9 @@ + + + @@ -173,6 +176,9 @@ Curve Creator + + + @@ -268,6 +274,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -284,9 +303,6 @@ - - - @@ -308,19 +324,6 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -331,7 +334,7 @@ - 40 + 10 20