Commit ad82d716 authored by Sharaf Zaman's avatar Sharaf Zaman
Browse files

Update color of stop in Tool Options Docker

parent a848000c
......@@ -199,6 +199,11 @@ SvgMeshStop SvgMeshArray::getStop(const SvgMeshPatch::Type edge, const int row,
assert(false);
}
SvgMeshStop SvgMeshArray::getStop(const SvgMeshPosition &pos) const
{
return getStop(pos.segmentType, pos.row, pos.col);
}
std::array<QPointF, 4> SvgMeshArray::getPath(const SvgMeshPatch::Type edge, const int row, const int col) const
{
KIS_ASSERT(row < m_array.size() && col < m_array[row].size()
......
......@@ -64,6 +64,8 @@ public:
/// Get the point of a node in mesharray
SvgMeshStop getStop(const SvgMeshPatch::Type edge, const int row, const int col) const;
SvgMeshStop getStop(const SvgMeshPosition &pos) const;
/// Get the Path Points for a segment of the meshpatch
std::array<QPointF, 4> getPath(const SvgMeshPatch::Type edge, const int row, const int col) const;
......
......@@ -324,6 +324,7 @@ KoFillConfigWidget::KoFillConfigWidget(KoCanvasBase *canvas, KoFlake::FillVarian
// meshgradient
connect(d->ui->meshStopColorButton, SIGNAL(changed(const KoColor&)), this, SLOT(slotMeshHandleColorChanged(const KoColor&)));
d->ui->spinbRows->setRange(1, 20);
d->ui->spinbColumns->setRange(1, 20);
connect(d->ui->spinbRows, SIGNAL(valueChanged(int)), SLOT(slotMeshGradientChanged()));
......@@ -384,6 +385,7 @@ void KoFillConfigWidget::forceUpdateOnSelectionChanged()
void KoFillConfigWidget::setSelectedMeshGradientHandle(const SvgMeshPosition &position)
{
d->meshposition = position;
updateMeshGradientUI();
}
void KoFillConfigWidget::setNoSelectionTrackingMode(bool value)
......@@ -923,12 +925,24 @@ void KoFillConfigWidget::updateMeshGradientUI()
{
KisSignalsBlocker b(d->ui->spinbRows,
d->ui->spinbColumns,
d->ui->cmbSmoothingType);
d->ui->cmbSmoothingType,
d->ui->meshStopColorButton);
SvgMeshArray *mesharray = d->activeMeshGradient->getMeshArray().data();
d->ui->spinbRows->setValue(mesharray->numRows());
d->ui->spinbColumns->setValue(mesharray->numColumns());
d->ui->cmbSmoothingType->setCurrentIndex(d->activeMeshGradient->type());
if (d->meshposition.isValid()) {
QColor qc = d->activeMeshGradient->getMeshArray()->getStop(d->meshposition).color;
KoColor c = d->ui->meshStopColorButton->color();
c.fromQColor(qc);
d->ui->meshStopColorButton->setColor(c);
d->ui->meshStopColorButton->setDisabled(false);
} else {
d->ui->meshStopColorButton->setDisabled(true);
}
}
void KoFillConfigWidget::shapeChanged()
......@@ -1087,6 +1101,7 @@ void KoFillConfigWidget::updateWidgetComponentVisbility()
d->ui->spinbColumns->setVisible(true);
d->ui->smoothingTypeLabel->setVisible(true);
d->ui->cmbSmoothingType->setVisible(true);
d->ui->meshStopColorButton->setAlphaChannelEnabled(true);
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment