Skip to content

Commit 62b9f60

Browse files
committedOct 15, 2018
Some 💅
1 parent 09ee755 commit 62b9f60

File tree

1 file changed

+26
-12
lines changed

1 file changed

+26
-12
lines changed
 

‎src/app/qgsgeometryvalidationdock.cpp

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ QgsGeometryValidationDock::QgsGeometryValidationDock( const QString &title, QgsM
4848
mFeatureRubberband->setWidth( scaleFactor );
4949
mFeatureRubberband->setStrokeColor( QColor( 100, 255, 100, 100 ) );
5050

51-
mErrorRubberband->setColor( QColor( 180, 250, 180, 100 ) );
51+
mErrorRubberband->setColor( QColor( "#ffee58ff" ) );
5252
mErrorRubberband->setWidth( scaleFactor );
5353

5454
mErrorLocationRubberband->setIcon( QgsRubberBand::ICON_X );
@@ -193,22 +193,36 @@ void QgsGeometryValidationDock::showHighlight( const QModelIndex &current )
193193

194194
mFeatureRubberband->setToGeometry( featureGeometry );
195195

196-
197-
QPropertyAnimation *animation = new QPropertyAnimation( mFeatureRubberband, "fillColor" );
198-
animation->setEasingCurve( QEasingCurve::OutQuad );
199-
connect( animation, &QPropertyAnimation::finished, animation, &QPropertyAnimation::deleteLater );
200-
connect( animation, &QPropertyAnimation::valueChanged, this, [this]
196+
QPropertyAnimation *featureAnimation = new QPropertyAnimation( mFeatureRubberband, "fillColor" );
197+
featureAnimation->setEasingCurve( QEasingCurve::OutQuad );
198+
connect( featureAnimation, &QPropertyAnimation::finished, featureAnimation, &QPropertyAnimation::deleteLater );
199+
connect( featureAnimation, &QPropertyAnimation::valueChanged, this, [this]
201200
{
202201
mFeatureRubberband->update();
203202
} );
204203

205-
animation->setDuration( 2000 );
206-
animation->setStartValue( QColor( 100, 255, 100, 255 ) );
207-
animation->setEndValue( QColor( 100, 255, 100, 0 ) );
204+
featureAnimation->setDuration( 2000 );
205+
featureAnimation->setStartValue( QColor( 100, 255, 100, 255 ) );
206+
featureAnimation->setEndValue( QColor( 100, 255, 100, 0 ) );
207+
208+
featureAnimation->start();
209+
210+
mErrorRubberband->setToGeometry( errorGeometry );
211+
212+
QPropertyAnimation *errorAnimation = new QPropertyAnimation( mErrorRubberband, "fillColor" );
213+
errorAnimation->setEasingCurve( QEasingCurve::OutQuad );
214+
connect( errorAnimation, &QPropertyAnimation::finished, featureAnimation, &QPropertyAnimation::deleteLater );
215+
connect( errorAnimation, &QPropertyAnimation::valueChanged, this, [this]
216+
{
217+
mErrorRubberband->update();
218+
} );
219+
220+
errorAnimation->setStartValue( QColor( "#ffee58ff" ) );
221+
errorAnimation->setEndValue( QColor( "#ffee5800" ) );
208222

209-
animation->start();
223+
errorAnimation->setDuration( 2000 );
224+
errorAnimation->start();
210225

211-
// mErrorRubberband->setToGeometry( errorGeometry );
212-
mErrorLocationRubberband->setToGeometry( QgsGeometry( new QgsPoint( locationGeometry ) ) );
226+
mErrorLocationRubberband->setToGeometry( QgsGeometry( qgis::make_unique<QgsPoint>( locationGeometry ) ) );
213227
}
214228
}

0 commit comments

Comments
 (0)
Please sign in to comment.